I have a dropdownlist that is filled with items.
I show and hide the div surrounding the dropdownlist using the following code .
divPCSelection.Style.Add("display", bo.User ? "none" : "normal");
This hides and show fine.
When I do a post back and look at the pages view source, the div shows the style display:none. The dropdown also shows all the items in the dropdown.
If then do a jquery "show" of the div, the div shows but the dropdown is now empty.
The jquery code is:
It doesn't seem to actually be empty as I can do a normal postback and the data is now back in the dropdownlist.
What is happening here?
Thanks,
Tom
I show and hide the div surrounding the dropdownlist using the following code .
divPCSelection.Style.Add("display", bo.User ? "none" : "normal");
This hides and show fine.
When I do a post back and look at the pages view source, the div shows the style display:none. The dropdown also shows all the items in the dropdown.
If then do a jquery "show" of the div, the div shows but the dropdown is now empty.
The jquery code is:
Code:
function TogglePCSelection() {
if ($("#<%=chkUser.ClientID%>").is(":checked")) {
$("#<%=divPCSelection.ClientID%>").hide();
}
else {
$("#<%=divPCSelection.ClientID%>").show();
}
}
It doesn't seem to actually be empty as I can do a normal postback and the data is now back in the dropdownlist.
What is happening here?
Thanks,
Tom