473,377 Members | 1,119 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

.NET 2.0 Grid View Control and the hyperlinkfield column


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
2 3281
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sck10 | last post by:
Hello, I am using a datagrid and am trying to control the column widths for each column. Is this possible? I have tried using the following: ControlStyle-BorderWidth="1000" with no apparent...
0
by: John Smith | last post by:
I am trying to add a HyperLinkField to a datagrid programatically, but I keep running into the error: "CS1502: The best overloaded method match for...
0
by: weiwei | last post by:
Hi; I am having trouble to get variable from grid view. here is my scenario. I want to delete a row in database from web page, in additon, I also want to delete that user's directory in c:drive. ...
1
by: parez | last post by:
Hi all, I have a storep procedure which returns 5 columns. i want to show only two columsn in the grid view. first column is a link based on some 3 of the columns. i added the following in...
8
by: =?Utf-8?B?TWlrZSBSYW5k?= | last post by:
I am trying to get a list of files from a specified directory using the System.IO namespace classes, and then use that list as the datasource for a GridView. I have been able to do this...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
2
by: Valli | last post by:
Hi, I am using a gridview to display data from table. In the gridview, there are 5 columns in which one column contains link name(eg. http://www.msn.com). I want to show this link as an...
1
sujathaeeshan
by: sujathaeeshan | last post by:
Hi All, I am doing UI design(form design modifications) not programmatically. I am facing problem while appplying font to Data grid column . Here i am placing Data Grid within GroupBox. When...
3
by: kimbred | last post by:
Can someone help? I have the code below in which I'm attempting to show or hide the edit control in a gridview based on the value of a column in that view. It doesn't seem to find the control. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.