.NET 2.0 Grid View Control and the hyperlinkfield column

  • Thread starter Thread starter Evian Spring
  • Start date Start date
E

Evian Spring

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!
 
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.
 
Back
Top