Reading panel visible attribute that was manipulated with Javascript

  • Thread starter Thread starter John
  • Start date Start date
J

John

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 both in client Javascript and code behind. Is there a better way?

John
 
Hi, John

1. The concept of visible is different between server side
and client side. In server side, if a control's Visible
property is false, it is not rendered to the client.
You might get the display style on server side by:
Panel.Style("display")

2. display style is different from visibility. Unlike
display:none, objects that are not visible still reserve
the same physical space in the content layout as they
would if they were visible.
Panel.style.display = 'none' doesn't mean
Panel.style.visibility = 'hidden'
You might get the visibility style on server side by:
Panel.Style("visibility")


Bin Song, MCP
 
Back
Top