Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 September 30th, 2005, 08:22 AM
Registered User
 
Join Date: Sep 2005
Location: , FL, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Varying DataGrid URLs

Hi all. I have a DataGrid for which the datasource is a DataTable. For each row in the DataGrid, there is a different hyperlink to a pop-up web page.

I have created a hyperlink column in my DataGrid, but don't know how to code it in my code behind to have a different hyperlink for each row/hyperlink column to my pop-up web page.

I bind to my datasource first, then want to set up the different pop-up web page hyperlinks for each row/column.

I was originally using an ASP.Net table, but was asked to use a DataGrid instead. I accomplished it in the ASP.Net table by creating a literal control and a hyperlink control and adding each to the row column. Here's the syntax I used for the hyperlink control attribute:

exph.Attributes.Add("onclick", "javascript:window.open('TchrSubjExpDetail.aspx',' exp','width=820,height=675,resizable=no,left=25,to p=5')")

Now I need to do something similar with my DataGrid.

Any ideas or suggestions would be appreciated.

Thanks,

Sue
 
Old September 30th, 2005, 11:34 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Try placing that code in the datagrid's ItemDataBoundEvent





Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox with varying background colors Satal Keto Access VBA 2 January 30th, 2008 11:23 AM
varying data range stealthdevil Excel VBA 6 July 27th, 2007 02:30 AM
Datagrid with varying controls on each row aldwinenriquez Classic ASP Basics 1 June 25th, 2005 11:31 PM
Create All Possible Combinations From Varying Sets DolphinBay ASP.NET 1.0 and 1.1 Professional 7 April 26th, 2005 10:55 AM
Re-Using an Array (for strings of varying lengths) WebDevel Javascript How-To 2 December 6th, 2003 06:46 AM





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