Wednesday, January 9, 2013

Set TextBox Text using Jquery in ASP.NET


.aspx page

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

Jquery code.

<script src="jquery-1.8.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=TextBox1.ClientID %>").val("FirstName");
$("#<%=TextBox2.ClientID %>").val("LastName");
});
</script>

No comments:
Write comments
Recommended Posts × +