views:

45

answers:

1

this is my vb.net code -

in the subroutine i have -

Private Sub xxx()

Sqlstr = "SELECT * FROM table"
            ExecuteNonQuery(Sqlstr)
SqlCmd = New SqlCommand(Sqlstr, SqlCnn)
            SqlDR = SqlCmd.ExecuteReader
            If SqlDR.HasRows Then
                Do While SqlDR.Read()
                    r = New TableRow

                    Dim l As New LinkButton
                    l.Text = SqlDR("column_name")
                    l.Attributes.Add("onClick", "setAction(" + CStr(SqlDR("id")) + ",'edit')")
                    l.ID = SqlDR("id")

                    c = New TableCell
                    c.Controls.Add(l)
                    r.Cells.Add(c)
....

so when the person clicks on the hyperlink that i have provided here, i goto page_load and do this

If (Me.pageAction.Value = "edit") Then
               Response.Redirect("next.aspx?id=" ???? - i dont know what to put here.
            End If

i want the next.aspx page to have the value of edit that was clicked on (so the ID value)

Am i doing this whole thing right or does someone have a better solution, simpler and cleaner one?

A: 
Response.Redirect("next.aspx?Field=Value&AnotherField=AnotherValue")

To get it back in the next page:

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim field As String = Request.QueryString("Field")
    Dim anotherField As String = Request.QueryString("AnotherField")
End Sub

You might wanna ahve a look at this article for further details.

JohnIdol