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

  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. 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. Quentin
    Replies:
    1
    Views:
    487
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    482
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,941
    Holger (David) Wagner
    Jul 3, 2004
  4. Replies:
    2
    Views:
    1,852
    Steve C. Orr [MVP, MCSD]
    Apr 26, 2006
  5. Joe
    Replies:
    1
    Views:
    373
    Jeffrey Tan[MSFT]
    Feb 16, 2004
Loading...

Share This Page