Hiding and showing panel in client side in aspnet

Discussion in 'ASP .Net' started by wandali@rogers.com, Mar 18, 2005.

  1. Guest

    Hello,

    I have a problem in finding the status of a panel (visible or not). I
    have a dropdownlist that associates with a panel in which textbox are
    embeded in the panel. A client side VBScript is run when the value of
    the dropdown change. And here is the script


    if document.all(dropdown).value ="-1" then
    document.all(panel).style.display = "block"
    else
    document.all(panel).style.display = "none"
    end if

    When I do validation at ther server, how do I know if the panel is
    visible or not?

    Panel.visible is always true, Panel.style("Display") is always = ""

    I don't want to make the panel visible from the server side, as the
    AutoPostBack is really annoying, but I have to do a lot of validation
    at the server, is there any suggestion in my approach or how can I get
    around that, am I doing something wrong?

    Thanks in advance.
    Wanda
    , Mar 18, 2005
    #1
    1. Advertising

  2. On Fri, 18 Mar 2005 12:35:29 -0600, <> wrote:

    > Hello,
    >
    > I have a problem in finding the status of a panel (visible or not). I
    > have a dropdownlist that associates with a panel in which textbox are
    > embeded in the panel. A client side VBScript is run when the value of
    > the dropdown change. And here is the script
    >
    >
    > if document.all(dropdown).value ="-1" then
    > document.all(panel).style.display = "block"
    > else
    > document.all(panel).style.display = "none"
    > end if
    >
    > When I do validation at ther server, how do I know if the panel is
    > visible or not?
    >
    > Panel.visible is always true, Panel.style("Display") is always = ""
    >
    > I don't want to make the panel visible from the server side, as the
    > AutoPostBack is really annoying, but I have to do a lot of validation
    > at the server, is there any suggestion in my approach or how can I get
    > around that, am I doing something wrong?
    >
    > Thanks in advance.
    > Wanda
    >


    Try accessing it's style info via the Style property to see if it was
    hidden:

    http://msdn.microsoft.com/library/d...webuiwebcontrolswebcontrolclassstyletopic.asp

    The problem is that on the client-side the viewstate string already says
    the panel was visible, and that is a 'static' hidden field. So you have
    to know it is 'incorrect'....

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Mar 18, 2005
    #2
    1. Advertising

  3. On the server, the display style of the div will not be available. Only
    posted form data. However, if you can write a JavaScript function that hides
    the div, you can certainly write JavaScript that populates a hidden form
    field. ;-)

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.

    <> wrote in message
    news:...
    > Hello,
    >
    > I have a problem in finding the status of a panel (visible or not). I
    > have a dropdownlist that associates with a panel in which textbox are
    > embeded in the panel. A client side VBScript is run when the value of
    > the dropdown change. And here is the script
    >
    >
    > if document.all(dropdown).value ="-1" then
    > document.all(panel).style.display = "block"
    > else
    > document.all(panel).style.display = "none"
    > end if
    >
    > When I do validation at ther server, how do I know if the panel is
    > visible or not?
    >
    > Panel.visible is always true, Panel.style("Display") is always = ""
    >
    > I don't want to make the panel visible from the server side, as the
    > AutoPostBack is really annoying, but I have to do a lot of validation
    > at the server, is there any suggestion in my approach or how can I get
    > around that, am I doing something wrong?
    >
    > Thanks in advance.
    > Wanda
    >
    Kevin Spencer, Mar 18, 2005
    #3
  4. Wanda Li Guest

    Is there a way I can retrieve the status (visibility) of a server side
    panel? If I do it thru' javascript, how can I get the answer from my
    aspnet page (server side)

    Thanks
    Wanda

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Wanda Li, Mar 18, 2005
    #4
  5. On Fri, 18 Mar 2005 13:22:44 -0600, Craig Deelsnyder
    <cdeelsny@no_spam_4_meyahoo.com> wrote:

    > On Fri, 18 Mar 2005 12:35:29 -0600, <> wrote:
    >
    >> Hello,
    >>
    >> I have a problem in finding the status of a panel (visible or not). I
    >> have a dropdownlist that associates with a panel in which textbox are
    >> embeded in the panel. A client side VBScript is run when the value of
    >> the dropdown change. And here is the script
    >>
    >>
    >> if document.all(dropdown).value ="-1" then
    >> document.all(panel).style.display = "block"
    >> else
    >> document.all(panel).style.display = "none"
    >> end if
    >>
    >> When I do validation at ther server, how do I know if the panel is
    >> visible or not?
    >>
    >> Panel.visible is always true, Panel.style("Display") is always = ""
    >>
    >> I don't want to make the panel visible from the server side, as the
    >> AutoPostBack is really annoying, but I have to do a lot of validation
    >> at the server, is there any suggestion in my approach or how can I get
    >> around that, am I doing something wrong?
    >>
    >> Thanks in advance.
    >> Wanda
    >>

    >
    > Try accessing it's style info via the Style property to see if it was
    > hidden:
    >
    > http://msdn.microsoft.com/library/d...webuiwebcontrolswebcontrolclassstyletopic.asp
    >
    > The problem is that on the client-side the viewstate string already says
    > the panel was visible, and that is a 'static' hidden field. So you have
    > to know it is 'incorrect'....
    >


    Actually, this may have the same problem...Kevin's approach would
    definitely work...

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Mar 18, 2005
    #5
  6. From the hidden form field!

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.

    "Wanda Li" <> wrote in message
    news:en1hXV$...
    >
    >
    > Is there a way I can retrieve the status (visibility) of a server side
    > panel? If I do it thru' javascript, how can I get the answer from my
    > aspnet page (server side)
    >
    > Thanks
    > Wanda
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Kevin Spencer, Mar 18, 2005
    #6
  7. Wanda Li Guest

    Here is what I am working on, I have to check if a textbox is filled or
    not. If it is visible, then it must be filled. That's why I need to know
    the status (visiblilty) of the panel (in which the textbox embeded in
    it). Or is there any workaround?

    Thanks
    Wanda


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Wanda Li, Mar 18, 2005
    #7
    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. Joey
    Replies:
    1
    Views:
    794
    =?Utf-8?B?aGVpbg==?=
    Jan 3, 2006
  2. Boss302
    Replies:
    0
    Views:
    1,038
    Boss302
    Nov 21, 2006
  3. Bogdan
    Replies:
    2
    Views:
    648
    Bogdan
    Jun 9, 2008
  4. Zoe Hart
    Replies:
    1
    Views:
    366
    Scott Wisniewski
    Jan 8, 2004
  5. Kevin Humphreys

    Showing/Hiding a Panel in a Repeater

    Kevin Humphreys, Nov 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    421
    MikeS
    Nov 10, 2006
Loading...

Share This Page