469,950 Members | 1,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Hiding and showing panel in client side in aspnet

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

Nov 19 '05 #1
6 2849
On Fri, 18 Mar 2005 12:35:29 -0600, <wa*****@rogers.com> 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/de...styletopic.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
Nov 19 '05 #2
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.

<wa*****@rogers.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Nov 19 '05 #3


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!
Nov 19 '05 #4
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, <wa*****@rogers.com> 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/de...styletopic.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
Nov 19 '05 #5
From the hidden form field!

--
HTH,

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

"Wanda Li" <wa*****@rogers.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...


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!

Nov 19 '05 #6

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!
Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by James | last post: by
3 posts views Thread by Charlie Dison | last post: by
9 posts views Thread by Bill Long | last post: by
2 posts views Thread by =?Utf-8?B?Sm9zaCBTY2htaWR0?= | last post: by
1 post views Thread by Doug | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.