<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
function Test1(w) {
document.getElementById('<%=TextBox1.ClientID%>').style.width = w;
return false;
}
Test1(10); // This line arises an error. Why ?
</script>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input id="Button1" type="button" value="button" onclick="Test1(10)" />
</asp:Content>
I get error when the function Test1(10) is called from the script. But when it called on the click of button, it works fine. How can I call the function from the script(OR how I can access the onload() function in an ASP.NET Content Page)?