buttonColumn and target=_blank
Hi,
I have a dg with a button column. When the user clicks the button I want a new page to open.
I am using DataGrid1_ItemCommand as I have a few buttons and I need to pass several parameters in my url such as:
<code>
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles DataGrid1.ItemCommand
If e.Item.ItemIndex >= 0 Then
Dim userCell As TableCell = e.Item.Cells(0)
Dim ad_id As String = userCell.Text
Dim posterCell As TableCell = e.Item.Cells(1)
Dim ad_poster As String = posterCell.Text
Dim cat_cell As TableCell = e.Item.Cells(12)
Dim cat_id As String = cat_cell.Text
Dim sub_cell As TableCell = e.Item.Cells(13)
Dim sub_id As String = sub_cell.Text
If e.CommandSource.commandname = "siteAd" Then
Response.Redirect("http://www.mysite.com/ads.aspx?cat_id=" & cat_id & "&sub_id=" & sub_id & "&ad_id=" & ad_id)
End If
</code>
The problem is that I am not sure how to open the link in a new page.
Can someone please help?
Thanks
|