HyperLink from GridView

Discussion in 'ASP .Net' started by David, Sep 21, 2006.

  1. David

    David Guest

    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
     
    David, Sep 21, 2006
    #1
    1. Advertising

  2. David

    Mark Rae Guest

    "David" <> wrote in message
    news:...

    > 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
     
    Mark Rae, Sep 21, 2006
    #2
    1. Advertising

  3. David

    David Guest

    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" <> wrote in message
    news:%...
    > "David" <> wrote in message
    > news:...
    >
    >> 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
    >
     
    David, Sep 21, 2006
    #3
  4. David

    Mark Rae Guest

    "David" <> wrote in message
    news:...

    > Am i missing something?


    Yes - use a LinkButton...
     
    Mark Rae, Sep 21, 2006
    #4
  5. David

    David Guest

    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" <> wrote in message
    news:%...
    > "David" <> wrote in message
    > news:...
    >
    >> Am i missing something?

    >
    > Yes - use a LinkButton...
    >
     
    David, Sep 21, 2006
    #5
  6. David

    Mark Rae Guest

    "David" <> wrote in message
    news:%...

    > 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.
     
    Mark Rae, Sep 22, 2006
    #6
  7. David

    David Guest

    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" <> wrote in message
    news:...
    > "David" <> wrote in message
    > news:%...
    >
    >> 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.
    >
     
    David, Sep 22, 2006
    #7
  8. David

    Mark Rae Guest

    "David" <> wrote in message
    news:...

    > 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.
     
    Mark Rae, Sep 22, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,007
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  2. davetichenor
    Replies:
    1
    Views:
    856
    Eliyahu Goldin
    Oct 30, 2006
  3. Keith G Hicks
    Replies:
    3
    Views:
    778
    Keith G Hicks
    Feb 18, 2008
  4. Ken
    Replies:
    1
    Views:
    395
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    968
Loading...

Share This Page