Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hiding and showing panel in client side in aspnet

Reply
Thread Tools

Hiding and showing panel in client side in aspnet

 
 
wandali@rogers.com
Guest
Posts: n/a
 
      03-18-2005
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

 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      03-18-2005
On Fri, 18 Mar 2005 12:35:29 -0600, <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      03-18-2005
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.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
Wanda Li
Guest
Posts: n/a
 
      03-18-2005


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!
 
Reply With Quote
 
Craig Deelsnyder
Guest
Posts: n/a
 
      03-18-2005
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, <(E-Mail Removed)> 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
 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      03-18-2005
From the hidden form field!

--
HTH,

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

"Wanda Li" <(E-Mail Removed)> wrote in message
news:en1hXV$(E-Mail Removed)...
>
>
> 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!



 
Reply With Quote
 
Wanda Li
Guest
Posts: n/a
 
      03-18-2005

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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Showing/Hiding a Panel in a Repeater Kevin Humphreys ASP .Net Web Controls 1 11-10-2006 10:06 PM
How-to? - Process Client-side AND Server-side Code Blocks With aspnet Button Joey ASP .Net 1 01-03-2006 11:01 PM
Adding custom client-side onClick handler with client-side validator controls Zoe Hart ASP .Net Web Controls 1 01-08-2004 10:45 PM



Advertisments