By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jan 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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)

<vn******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr 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

Jan 23 '06 #2

P: n/a
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.

Jan 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.