I have a datagridview with an imagebutton that will allow the user to select a record within the grid for editing purposes. I'm trying to open a new window instead of a response.redirect. see code below
The only way I can seem to get this to work is by using response.write. is there a better way to do this ? Thanks in advance
Protected Sub lnkEdit_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim lnkbtn As ImageButton = TryCast(sender, ImageButton)
Dim gvrow As GridViewRow = TryCast(lnkbtn.NamingContainer, GridViewRow)
Dim id As Integer = Convert.ToInt32(dg.DataKeys(gvrow.RowIndex).Value.ToString())
Session("id") = id
Response.Write("<script>")
Response.Write("window.open('Myform.aspx','_blank')")
Response.Write("</script>")
End Sub
The only way I can seem to get this to work is by using response.write. is there a better way to do this ? Thanks in advance
Protected Sub lnkEdit_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim lnkbtn As ImageButton = TryCast(sender, ImageButton)
Dim gvrow As GridViewRow = TryCast(lnkbtn.NamingContainer, GridViewRow)
Dim id As Integer = Convert.ToInt32(dg.DataKeys(gvrow.RowIndex).Value.ToString())
Session("id") = id
Response.Write("<script>")
Response.Write("window.open('Myform.aspx','_blank')")
Response.Write("</script>")
End Sub