<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
ShowValue = function()
{
document.getElementById("TextBox1").value="erert";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Text="2"></asp:TextBox>
</div>
<textarea rows="10" cols="30"
</form>
</body>
</html>
--------------------------- In Code Behind----------------------------------
protected override void OnInit(EventArgs e)
{
Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "ShowValue()", true);
}
you can also call the java script in OnLoad, OnLoadCompleted and etc.
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
ShowValue = function()
{
document.getElementById("TextBox1").value="erert";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Text="2"></asp:TextBox>
</div>
<textarea rows="10" cols="30"
</form>
</body>
</html>
--------------------------- In Code Behind----------------------------------
protected override void OnInit(EventArgs e)
{
Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "ShowValue()", true);
}
you can also call the java script in OnLoad, OnLoadCompleted and etc.
Comments