Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid - get the row's column value when clicking on a hyperlink cell

Reply
Thread Tools

datagrid - get the row's column value when clicking on a hyperlink cell

 
 
vndaxanh@yahoo.com
Guest
Posts: n/a
 
      01-23-2006
Hi everyone,

I have an aspx page with a datagrid column which bound to a dataset at
page_load. It contains 2 columns, Key and Hyperlink. What I want to
do is when I click on the hyperlink it will set a session variable to
the Key column like so:

Session["SomeKey"] = column 0 of row of the hyperlink clicked on.

How do I do this? Thanks in a advance for your help!

Hanna

 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      01-23-2006
you need to change the hyperlink to a link button, and on the postback use
the Redirect method to do the link.

-- bruce (sqlwork.com)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi everyone,
>
> I have an aspx page with a datagrid column which bound to a dataset at
> page_load. It contains 2 columns, Key and Hyperlink. What I want to
> do is when I click on the hyperlink it will set a session variable to
> the Key column like so:
>
> Session["SomeKey"] = column 0 of row of the hyperlink clicked on.
>
> How do I do this? Thanks in a advance for your help!
>
> Hanna
>



 
Reply With Quote
 
 
 
 
vndaxanh@yahoo.com
Guest
Posts: n/a
 
      01-23-2006
Thanks for your reply, Bruce.

However, I can get the link to work properly. My problem is that I
don't know how to get the value of the Key column once I've clicked the
hyperlink. The hyperlink takes me to another page, but before it does
I need to set a session variable to the Key column of the selected
hyperlink.

this is my datagrid for example:

Key Link
1 descriptionA
2 descriptionB
3 descriptionC

When I click on descriptionB, before it takes me to another page I want
to get the value 2 out and put that value into a session variable.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
IsPostBack not true when clicking hyperlink column in a programmatically created datagrid TB ASP .Net 0 04-22-2006 05:03 PM
Making a cell editable on clicking the cell Prasad Peesapati ASP .Net Web Controls 0 02-03-2005 02:43 PM
datagrid-how to get cell value(hyperlink column) =?Utf-8?B?UGF1bA==?= ASP .Net 9 10-12-2004 11:39 PM



Advertisments