Asynchronous Request to Server (JavaScript)
July 16, 2008 Leave a comment
I have seen posts today asking for Asynchronous Request to Server which will Query the Database for certain information.
Here, I am giving one example, which will send an Asynchronous Request to server for Checking the availablity of the UserName entered by the user against database.
Below is my WebPage:
<div>
<asp:Label ID=”Label1″ runat=”server” Text=”UserName:”></asp:Label>
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>
<asp:Button ID=”Button1″ runat=”server” Text=”Button” OnClientClick=”return CheckUserNameAvailablity1()” />
</div>
Here, I have attached a JavaScript Function CheckUserNameAvailablity1() with OnClientClick Property of the Button Control. Below is that JavaScript Function:
