Accessing hidden controls on ascx page

Discussion in 'ASP .Net Building Controls' started by krallabandi@gmail.com, Apr 26, 2006.

  1. Guest

    I have a hidden control
    <input id="FieldSortOrder" type="hidden" name="FieldSortOrder"
    runat="server"> in a ascx page. I want to store some value in this
    control in the code behind page.

    FieldSortOrder.Value = "xyz"

    I am getting compilation errors - 'FieldSortOrder' is not declared.

    The same thing is working good on aspx. how can it be done on ascx?


    Thanks.
     
    , Apr 26, 2006
    #1
    1. Advertisements

  2. Are you trying to access the control from within the ASCX code behind, or
    from within the Page's code behind?
    If you're trying to access it from the Page's code behind, this should help:
    http://SteveOrr.net/faq/PassDataToUserControl.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net



    <> wrote in message
    news:...
    >I have a hidden control
    > <input id="FieldSortOrder" type="hidden" name="FieldSortOrder"
    > runat="server"> in a ascx page. I want to store some value in this
    > control in the code behind page.
    >
    > FieldSortOrder.Value = "xyz"
    >
    > I am getting compilation errors - 'FieldSortOrder' is not declared.
    >
    > The same thing is working good on aspx. how can it be done on ascx?
    >
    >
    > Thanks.
    >
     
    Steve C. Orr [MVP, MCSD], Apr 26, 2006
    #2
    1. Advertisements

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. Quentin
    Replies:
    1
    Views:
    692
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    651
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    2,152
    Holger (David) Wagner
    Jul 3, 2004
  4. Replies:
    0
    Views:
    770
  5. Replies:
    2
    Views:
    1,992
    Steve C. Orr [MVP, MCSD]
    Apr 26, 2006
  6. Kevin Le

    Problem accessing controls in hidden panel

    Kevin Le, Sep 8, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    199
  7. Joe
    Replies:
    1
    Views:
    645
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  8. Replies:
    2
    Views:
    748
Loading...