Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HyperLink from GridView

Reply
Thread Tools

HyperLink from GridView

 
 
David
Guest
Posts: n/a
 
      09-21-2006
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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      09-21-2006
"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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/Con...ControlPSD.asp


 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      09-21-2006
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

"Mark Rae" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "David" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> 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/Con...ControlPSD.asp
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-21-2006
"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Am i missing something?


Yes - use a LinkButton...


 
Reply With Quote
 
David
Guest
Posts: n/a
 
      09-21-2006
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

"Mark Rae" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "David" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> Am i missing something?

>
> Yes - use a LinkButton...
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-22-2006
"David" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> 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.


 
Reply With Quote
 
David
Guest
Posts: n/a
 
      09-22-2006
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
"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "David" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>> 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.
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-22-2006
"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> OK, I got it to work.


Hurrah!

> I bound the CommandName and CommandArgument to the 2 column values I
> needed to pass and it worked.


That's right.

> Thank you.


You're welcome.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments