How do I manipulate my user control using JavaScript?
<body>
<form id="form1" runat="server">
<div>
<uc1:WebUserControl ID="WebUserControl1" runat="server" Enabled="False" />
<input id="Button1" type="button" value="button" runat="server" onclick="return Button1_onclick()" /></div>
</form>
<script type="text/javascript">
var handleUserControl = {
uc: document.getElementById("<%=WebUserControl1.ClientID%>"),
btn1: document.getElementById("<%=Button1.ClientID%%gt;"),
init: function() {
this.btn1.onclick = function() {
uc.setAttribute('Enabled', 'True'); //uc is null at this point
};
}
}
handleUserControl.init();
</script>
</body>