Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 14th, 2006, 01:00 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to monika.oberoi
Default Hyperlinks in GridView Columns

Hi
I am using one of the column of the gridview control as hyperlink field which is bounded to one the fields in the database.

I want to navigate the hyperlink to different URLs depending upon the value in that column of the gridview. Please make it sure that i am using this with gridview control in asp.net2.0 and not with datagrid as in asp1.0

Please reply.

  #2 (permalink)  
Old November 14th, 2006, 08:43 AM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 39
Thanks: 1
Thanked 0 Times in 0 Posts
Default

hi there,

I hope this will help you.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
 if (e.Row.RowType == DataControlRowType.DataRow)
 {
   HyperLink hlnk = (HyperLink)e.Row.Cells[0].Controls[1];
   hlnk.NavigateUrl = "javascript:getPage(" + hlnk.Text + ")";
 }
}

  #3 (permalink)  
Old December 22nd, 2006, 04:21 AM
Authorized User
 
Join Date: Nov 2006
Location: Mandi, Himachal Pradesh, India.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to akhilhp
Default

What if I want to send the hyperlink text to a session variable whenever it is clicked. I tried many things but could not get any where.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to freeze GridView columns? MLaGrange BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 September 16th, 2010 10:10 PM
Totaling columns in a footer row of a GridView psimonson ASP.NET 2.0 Basics 1 May 5th, 2008 01:34 PM
Adding columns to Gridview gagansharma7 ADO.NET 1 February 15th, 2008 10:54 AM
Need to get value of gridview template columns for kmh030 ASP.NET 2.0 Professional 1 January 6th, 2007 11:10 PM
hyperlinks sbhandar Classic ASP Basics 4 August 19th, 2004 09:17 AM



All times are GMT -4. The time now is 02:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.