Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   datagrid - get the row's column value when clicking on a hyperlink cell (http://www.velocityreviews.com/forums/t118009-datagrid-get-the-rows-column-value-when-clicking-on-a-hyperlink-cell.html)

vndaxanh@yahoo.com 01-23-2006 05:10 PM

datagrid - get the row's column value when clicking on a hyperlink cell
 
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


Bruce Barker 01-23-2006 05:34 PM

Re: datagrid - get the row's column value when clicking on a hyperlink cell
 
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)

<vndaxanh@yahoo.com> wrote in message
news:1138036218.762056.229710@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
>




vndaxanh@yahoo.com 01-23-2006 06:19 PM

Re: datagrid - get the row's column value when clicking on a hyperlink cell
 
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.



All times are GMT. The time now is 01:53 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.