.NET 2.0 Grid View Control and the hyperlinkfield column

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!
 
C

Christopher Reed

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top