1.) Set client side OnChange event on a Button, CheckBox, etc...
OnChanged="javascriptChangeHandler(this, 'Panel1');"
2.) Include the Panel named in the javascriptChangeHandler call in HTML
<asp:Panel id="Panel1" Runat="server">
Content...
</asp:Panel>
3.) Add the Javascript function to the page or within included .js file
function javascriptChangeHandler (elem, panel) {
var part = elem.id.substr(0, elem.id.lastIndexOf('_'));
//Handle part logic to determine if panel should be turned off or on
if ( part == null ) {
elem.focus();
return false;
} else if ( part == "someIdentity" ) {
document.getElementById(panel).style.display = "block";
} else {
document.getElementById(panel).style.display = "none";
}
}
}
No comments:
Post a Comment