I'd like to click a node in my ASP.NET TreeView and make visible=false;
. How do I do that in JavaScript?
You need to set a NagivateUrl equal to a Javascript function in the TreeView node to hide the button.
<asp:TreeView ID="TreeView1" runat="server" >
<Nodes>
<asp:TreeNode Text="" Value="" NavigateUrl="javascript:HideButton();"></asp:TreeNode>
</Nodes>
</asp:TreeView>
<script type="text/javascript" language="javascript">
function HideButton() {
document.getElementById('<%=Button1.ClientID %>').style.visibility = "hidden";
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With