HyperLink from GridView

D

David

Using ASP.Net 2.0 and VS 2005.
I have a search page that has server controls, (textboxes, dropdownlists,
etc.) that are used for searching and returning data in a GridView. One of
the GridView columns is a bound HyperLink that sends me to a new aspx page.
However, when I try to use Request.Form to get contents of the controls in
the search page all requests are blank. Is this because the hyperlink does
not do a Redirect? and thus the Request.Form is not available? If so, is
there an alternative way to accomplish this? I really like using the
hyperlink. Thanks.

David
 
M

Mark Rae

Using ASP.Net 2.0 and VS 2005.
I have a search page that has server controls, (textboxes, dropdownlists,
etc.) that are used for searching and returning data in a GridView. One
of the GridView columns is a bound HyperLink that sends me to a new aspx
page. However, when I try to use Request.Form to get contents of the
controls in the search page all requests are blank. Is this because the
hyperlink does not do a Redirect? and thus the Request.Form is not
available? If so, is there an alternative way to accomplish this? I
really like using the hyperlink. Thanks.

http://www.c-sharpcorner.com/asp/Controls/LinkButtonControlPSD.asp
 
D

David

Mark,
I read this but it references a LinkButton which I am not using. I am using
a HyperlInk control bound to a datafield in a gridView. There are no
CommandName and CommandArgument options in the properties of this control.
Am i missing something? Thanks.

David
 
D

David

I am trying that but the SelectedIndexChanged does not seem to fire. I
created a sub that would set the value from the row.cells(1) and nothing
happens, the screen just blinks. Doesn't clicking on this LinkButton select
the current row?

David
 
M

Mark Rae

I am trying that but the SelectedIndexChanged does not seem to fire.

That's right.
I created a sub that would set the value from the row.cells(1) and nothing
happens, the screen just blinks. Doesn't clicking on this LinkButton
select the current row?

No. You need to specifiy the value as the LinkButton's CommandArgument.
 
D

David

OK, I got it to work. I bound the CommandName and CommandArgument to the 2
column values I needed to pass and it worked. Thank you.

David
 

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
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top