I have a user control, say called
MyUserControl has a panel on it, panel1, and a combobox, NumberUnits
Depending on the value of "NumberUnits" (0-5) , Panel1 must be shown/hidden.
If numberUnits = 0, Panel1 should be hidden
else panel1 should be shown
On page_load, the "NumberUnits" combobox is set to a value in session, say Session("NumberUnits")
On a page using master page I have two instances of these. MyUserControl1 & MyUserControl2
HOWEVER there is a problem.
IF Panel1 is set to be hidden on loading, it is not rendered and so where the onchange event takes place nothing happens.
How do I get over this?
There are two things:
1) Panel1 must be able to be shown/hidden on changing NumberUnits combobox
2) Panel1 must be able to be shown/hidden on page load [so it needs to be rendered even if not visible on page load]
Hope this makes sense.
Thansk in advance for assisting with code....hopefully I'm not way off with what I've done so far...
function showHidePanel(panel, unitsChosen)
// show the panel
panel.style.visibility = "visible";
// hide the panel
panel.style.display = "none"; //to hide it