Show Item with javascript
Posted on: Mon Mar 02 12:16:38 -0800 2009. Updated on: Mon Mar 02 12:21:24 -0800 2009.
Category: Asp .Net AJAX / Javascript / CSS
Category: Asp .Net AJAX / Javascript / CSS
function ShowItem(itemId) {
var item = $get(itemId);
if (item.style.display == "none" || item.style.display == "") {
item.style.display = "block";
}
else {
item.style.display = "none";
}
}
If you are using masterpages, you will want to do something like this in your CS codebehind:
HyperLinkLogin.NavigateUrl = String.Format("javascript:ShowItem('{0}');", LoginPanel.ClientID);