Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 9th, 2004, 06:38 AM
Authorized User
Join Date: Oct 2003
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Default buttonColumn and target=_blank


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:
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

The problem is that I am not sure how to open the link in a new page.
Can someone please help?


Old March 10th, 2004, 08:17 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Take a look at the following thread. It has exactly what you are looking for.


Work smarter, not harder.
Old March 15th, 2004, 05:26 AM
Authorized User
Join Date: Oct 2003
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks :)

Similar Threads
Thread Thread Starter Forum Replies Last Post
NavigateUrl and Target spacy ASP.NET 1.x and 2.0 Application Design 9 November 5th, 2007 12:23 PM
How to change text on a ButtonColumn in a datagrid fidelio ASP.NET 1.0 and 1.1 Professional 4 March 21st, 2006 05:51 PM
target="_top" crmpicco HTML Code Clinic 3 March 23rd, 2005 12:50 PM
Edit/Delete ButtonColumn not working planoie ASP.NET 1.0 and 1.1 Professional 9 August 30th, 2004 07:39 AM
Datagrid ButtonColumn collie VB.NET 2002/2003 Basics 7 January 19th, 2004 09:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.