473,756 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(dr opdown).value ="-1" then
document.all(pa nel).style.disp lay = "block"
else
document.all(pa nel).style.disp lay = "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("Di splay") 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 3047
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(dr opdown).value ="-1" then
document.all(pa nel).style.disp lay = "block"
else
document.all(pa nel).style.disp lay = "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("Di splay") 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.goo glegroups.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(dr opdown).value ="-1" then
document.all(pa nel).style.disp lay = "block"
else
document.all(pa nel).style.disp lay = "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("Di splay") 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_sp am_4_meyahoo.co m> 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(dr opdown).value ="-1" then
document.all(pa nel).style.disp lay = "block"
else
document.all(pa nel).style.disp lay = "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("Di splay") 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******** ******@tk2msftn gp13.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1568
by: Ted Singh | last post by:
(I apologize in advance if this is an obvious question, my experience is more with console or client-only apps) I am trying to build an web-based HTML UI, which will work with a web-server on the same machine (i.e., http://localhost/...). However, I do not want the logic source to be visible to the user to prevent customer support problems, intellectual property issues, etc. The requirements strictly call for a web-based UI running...
1
3618
by: John | last post by:
I have a panel on a webpage. I use client Javacript to manipulate its visibility using something like: Panel.style.display = 'none'. During a postback, getting the Visible attribute always returns true whether the panel was visible or not. Is there another Javascript method to turn on/off a Panel's visibility *and* whose attribute can be read from code behind? I am thinking of using a hidden field as a flag placeholder which can be used...
4
17053
by: James | last post by:
Hello group: I'm trying to hide a panel control in javascript when a print button is clicked. On my web form, I have a button that fires a javascript function called doPrint(). No matter how I attempt to write the line to reference the panel control, I get a Null error or an Object does not exist error. I know this can be done in asp.net, but I need the event to fire at the client, otherwise the page will print before firing the...
3
2566
by: Charlie Dison | last post by:
Hi There, Should I be able to show and hide panels in an asp.net page without requiring a postback? I thought there was a way to do this using java script. Can anyone give me an example? I can't seem to find one that makes sense. Thanks.
2
2616
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the columns is not databound and instead has up to three hyperlinks in it (Edit, Award, and Cancel). A couple of the hyperlinks should not be shown in certain cases. Now, mind you, I don't know if it's being done in the way that's best to do it. It...
9
3187
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected... So the behavour is similar to a tab control. The user is expected to fill out required data on each of the panels before pressing a submit button which is visible from all panels. Problem I have is validating the data entered by the user. I...
2
1655
by: =?Utf-8?B?Sm9zaCBTY2htaWR0?= | last post by:
I have a gridview that is being used for managing inventory. The default view shows the stock currently available. When editing I don't want the stock to be directly edited, rather the user will enter the amount of items being added/removed. When the user clicks the 'Edit' link I want to hide the stock column and display a field for the TransactionAmt. I'm using the RowUpdating event to execute some functions used by that field. I've...
162
10289
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
1
1052
by: Doug | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user selects in that dropdownlist, this image will be hidden or be displayed. I have tied the onselectedindexchanged value of the dropdownlist to a c-sharp method (not javascript) because other things are being done as well that I want to do server side....
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9708
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.