M
Matt
Hi,
I'm writing an ASP.NET website which has a page containing a
Panel. I want the user to be able
to hide/display the panel at will by clicking a tickbox.
I have written some javascript code which either hides or displays the
panel when the tickbox is
clicked, which is working fine. Eg. It uses the following to hide the
panel:
pnlAdvancedSearch.style.display = 'none';
The problem comes when the form does a postback. If the panel is
hidden before the postback
occurs, then when the page is redrawn it doesn't display the panel (as
you'd expect). But then, clicking the tickbox results in a javascript
error, because it now doesn't recognize what the the panel
"pnlAdvancedSearch" is.
I'm probably doing this completely the wrong way. Can anyone give me
any advice?
Thanks,
Matt
I'm writing an ASP.NET website which has a page containing a
Panel. I want the user to be able
to hide/display the panel at will by clicking a tickbox.
I have written some javascript code which either hides or displays the
panel when the tickbox is
clicked, which is working fine. Eg. It uses the following to hide the
panel:
pnlAdvancedSearch.style.display = 'none';
The problem comes when the form does a postback. If the panel is
hidden before the postback
occurs, then when the page is redrawn it doesn't display the panel (as
you'd expect). But then, clicking the tickbox results in a javascript
error, because it now doesn't recognize what the the panel
"pnlAdvancedSearch" is.
I'm probably doing this completely the wrong way. Can anyone give me
any advice?
Thanks,
Matt