bevssi 0 Newbie Poster

Hi, I need to have VB ASP.NET MVC controller action that receives the pk from the current record, looks up the spouse id and redirects to that record. I'm very inexperienced with MVC so please excuse if this is totally wrong. Any help, comments or suggestions are greatly appreciated.

Public Function SpouseRedir(ByVal id As Integer)


        Dim q As New Query("SELECT TOP 1 s.People_First_Name AS FName, s.People_Last_Name As LName FROM oPeople p LEFT OUTER JOIN oPeople s ON s.people_ID = p.spouseid WHERE p.people_id=@id;")
       
 q.AddWithValue("@id", id)


        Return Redirect("/console/editthisrow.asp?TableName=oPeople&PrimaryKey=@id")


        Return View(id)
    End Function