Pass value of hidden fields in Gridview to SQL parameter

Discussion in 'ASP .Net Datagrid Control' started by Hennie, Jun 20, 2006.

  1. Hennie

    Hennie Guest

    How can I pass the value of a hidden field to the Parameter?

    Thanks
    Hennie, Jun 20, 2006
    #1
    1. Advertising

  2. What exactly is the problem?

    Eliyahu

    "Hennie" <> wrote in message
    news:%...
    > How can I pass the value of a hidden field to the Parameter?
    >
    > Thanks
    >
    Eliyahu Goldin, Jun 20, 2006
    #2
    1. Advertising

  3. Hennie

    Hennie Guest

    I have a field (column) in a gridview with visible set as false.
    I need the value of the field to be passed to a parameter in a stored
    procedure to update the database.

    When a field is hidden (visible=false) the value of the field is no longer
    accesable. Is there a work around?


    "Eliyahu Goldin" <> wrote in message
    news:...
    > What exactly is the problem?
    >
    > Eliyahu
    >
    > "Hennie" <> wrote in message
    > news:%...
    >> How can I pass the value of a hidden field to the Parameter?
    >>
    >> Thanks
    >>

    >
    >
    Hennie, Jun 20, 2006
    #3
  4. Columns with Visible=false don't render to the client and, naturally, don't
    come back to server with postbacks. A work around is to hide the column with
    css rule display:none while keeping Visible=true.

    Eliyahu

    "Hennie" <> wrote in message
    news:...
    >I have a field (column) in a gridview with visible set as false.
    > I need the value of the field to be passed to a parameter in a stored
    > procedure to update the database.
    >
    > When a field is hidden (visible=false) the value of the field is no longer
    > accesable. Is there a work around?
    >
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:...
    >> What exactly is the problem?
    >>
    >> Eliyahu
    >>
    >> "Hennie" <> wrote in message
    >> news:%...
    >>> How can I pass the value of a hidden field to the Parameter?
    >>>
    >>> Thanks
    >>>

    >>
    >>

    >
    >
    Eliyahu Goldin, Jun 21, 2006
    #4
  5. Hennie

    PeterKellner Guest

    On Tue, 20 Jun 2006 22:03:21 +0200, "Hennie" <>
    wrote:

    >I have a field (column) in a gridview with visible set as false.
    >I need the value of the field to be passed to a parameter in a stored
    >procedure to update the database.
    >
    >When a field is hidden (visible=false) the value of the field is no longer
    >accesable. Is there a work around?
    >
    >
    >"Eliyahu Goldin" <> wrote in message
    >news:...
    >> What exactly is the problem?
    >>
    >> Eliyahu
    >>
    >> "Hennie" <> wrote in message
    >> news:%...
    >>> How can I pass the value of a hidden field to the Parameter?
    >>>
    >>> Thanks
    >>>

    >>
    >>

    >


    You could also set the gridview attribute
    datakeynames=[id,myhiddenfieldid]

    and that will let you store in viewstate the value.
    Peter Kellner
    http://peterkellner.net
    PeterKellner, Jun 29, 2006
    #5
    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. Hole
    Replies:
    0
    Views:
    1,035
  2. Rick
    Replies:
    3
    Views:
    8,157
    Alexey Smirnov
    Apr 13, 2010
  3. Fred
    Replies:
    4
    Views:
    542
  4. Replies:
    0
    Views:
    280
  5. Abdul Mohsin
    Replies:
    1
    Views:
    264
Loading...

Share This Page