Problem accessing controls in hidden panel

Discussion in 'ASP .Net Web Controls' started by Kevin Le, Sep 8, 2003.

  1. Kevin Le

    Kevin Le Guest

    Hi all,

    I have problem accessing controls in a hidden panel.

    I have Control1 in Panel1. If Panel1 visible="true" then I can get
    value from Control1.text but if my Panel1 visible = "false" then my
    Control1.text return null.

    Does it require some special way to access controls in hidden panel or
    is it possible to access child controls of hidden panel at all? Please
    help.

    Thanks,
    Kevin

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kevin Le, Sep 8, 2003
    #1
    1. Advertising

  2. Since the Panel is not visible, the Server does not send it to the
    browser. You can check this by viewing the source of the page loaded in
    the browser. Since your control is embedded in this Panel, and the Panel
    is not written in the Response object by the server, it's obvious that
    the control is not written either, so it's null.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Sebastian Doroftei, Sep 9, 2003
    #2
    1. Advertising

  3. Kevin Le

    Kevin Le Guest

    Sebastian,

    Thanks for your reply!

    If I want to have a group hidden controls, for example:

    <input type="hidden" name="Control_Id" value="">

    in some sort of container/panel so that I can hide them from the users
    in a single visible property setting (instead of type="hidden" for each
    control) but still want to be able to access their values. Is there an
    easy way to do it?


    Thanks,
    Kevin



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kevin Le, Sep 9, 2003
    #3
  4. Kevin Le

    Dave Guest

    You could simply put them in a table which you hide by setting the style (
    VISIBILITY: hidden ) instead of using a control's .Visible property. That
    way it will be rendered to the browser but still hidden from view.

    "Kevin Le" <> wrote in message
    news:...
    > Sebastian,
    >
    > Thanks for your reply!
    >
    > If I want to have a group hidden controls, for example:
    >
    > <input type="hidden" name="Control_Id" value="">
    >
    > in some sort of container/panel so that I can hide them from the users
    > in a single visible property setting (instead of type="hidden" for each
    > control) but still want to be able to access their values. Is there an
    > easy way to do it?
    >
    >
    > Thanks,
    > Kevin
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Dave, Sep 11, 2003
    #4
    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. Replies:
    7
    Views:
    358
    Andrew Thompson
    Jan 24, 2005
  2. =?Utf-8?B?am9obiBwcnlvcg==?=

    Hidden Panel Problem

    =?Utf-8?B?am9obiBwcnlvcg==?=, Aug 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    412
    =?Utf-8?B?am9obiBwcnlvcg==?=
    Aug 3, 2007
  3. Rick
    Replies:
    3
    Views:
    8,314
    Alexey Smirnov
    Apr 13, 2010
  4. Accessing hidden controls on ascx page

    , Apr 26, 2006, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    160
    Steve C. Orr [MVP, MCSD]
    Apr 26, 2006
  5. SolarCanine
    Replies:
    2
    Views:
    305
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page