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

.NET 2.0 Grid View Control and the hyperlinkfield column

P: n/a

Hi,
I am using the new gridview control in .NET 2.0. I would like to
perform an action in the code behind when the user clicks one of the
hyperlink in the columns.

Is there an event I can do this in before the framework redirects to
the link?
asp:hyperlinkfield
I put temporary code in this event but they do not fire when I click
the link:
_RowCommand
_SelectedIndexChanged
_SelectedIndexChanging
In a nutshell what I want to do it this, after the user has click the
link, I want the code behind to load the object for that link so that
the next page has that object available in the session. I wanted to
avoid building the link with the querystring.
Is this possible with the GrivView object? or is there an other way
that would be better to accomplish this?

THANKS!

Feb 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
A hyperlink is just that: a link to another page. There are no events
associated.

You can, however, use a ButtonField and then do your processing in the
RowCommand method before redirecting to your desired page.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Evian Spring" <ev**********@canada.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

Hi,
I am using the new gridview control in .NET 2.0. I would like to
perform an action in the code behind when the user clicks one of the
hyperlink in the columns.

Is there an event I can do this in before the framework redirects to
the link?
asp:hyperlinkfield
I put temporary code in this event but they do not fire when I click
the link:
_RowCommand
_SelectedIndexChanged
_SelectedIndexChanging
In a nutshell what I want to do it this, after the user has click the
link, I want the code behind to load the object for that link so that
the next page has that object available in the session. I wanted to
avoid building the link with the querystring.
Is this possible with the GrivView object? or is there an other way
that would be better to accomplish this?

THANKS!

Feb 14 '06 #2

P: n/a
Thanks it is exactly what was needed.
Also, I found the way of having hidden fields in a grid view.

Microsoft reference:
http://msdn2.microsoft.com/en-us/lib...akeynames.aspx

Feb 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.