J
jasonmwilkerson
Can you access properties (Text, Visible, etc...) on server controls
(i.e. TextBox, Label, etc...) from javascript? I am trying to toggle
the visibility of a Label clientside.
<script type="text/javascript">
function toggle() {
var label = $get('<%=this.lblMessage.ClientID %>');
if (label != null) {
label.Visible = !label.Visible;
}
}
</script>
<asp:Label ID="lblMessage" runat="server" Text="Hello" />
<asp:Button ID="btnToggle" runat="server"
OnClientClick="toggle();return false;" />
Is this possible?
Thanks!
Jason
(i.e. TextBox, Label, etc...) from javascript? I am trying to toggle
the visibility of a Label clientside.
<script type="text/javascript">
function toggle() {
var label = $get('<%=this.lblMessage.ClientID %>');
if (label != null) {
label.Visible = !label.Visible;
}
}
</script>
<asp:Label ID="lblMessage" runat="server" Text="Hello" />
<asp:Button ID="btnToggle" runat="server"
OnClientClick="toggle();return false;" />
Is this possible?
Thanks!
Jason