First you need to add two update panel first will hold all of the content and with following properties
1.UpadteMode:conditional
2.childrenastriggers:false
3.Postback trigger controlid:"youbutonid"
now put another update panel inside of put youtextbox in which you are entering username.As shown below
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<asp:UpdatePanel ChildrenAsTriggers="false" UpdateMode="Conditional" ID="UpdatePanel1"
runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="InsertDetailsButton" />
</Triggers>
<ContentTemplate>
Put you main html here all that is going to postback on button click
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:TextBox ID="YourTextBox" runat="server" class="text requiredField email" AutoPostBack="True" OnTextChanged="ClientIdTxtBox_TextChanged"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
Now ontextchanged call event handler
protected void ClientIdTxtBox_TextChanged(object sender, EventArgs e)
{
try
if ( name_Exist==true)
{
ClientIdTxtBox.Text = "";
ScriptManager.RegisterStartupScript(this, GetType(), "AlertCode", "alert('User name already in use!');", true);
}
}
catch (Exception ex)
{
}
}
This will not postback whole of the page instead it will use partial postback.
Hope This helps!!!