Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8309921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:16:22+00:00 2026-06-08T19:16:22+00:00

My code Asp block: ———- <ContentTemplate> <asp:Label runat=server ID=lblHelloWorld Text=label /> <br /> <asp:TextBox

  • 0

My code
Asp block:

———-

            <ContentTemplate>
            <asp:Label runat="server" ID="lblHelloWorld" Text="label" />
            <br />
                <asp:TextBox ID="TextBox2"  AutoPostBack ="true" OnTextChanged="emailavail"  runat="server" ></asp:TextBox>
                <br />
            </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="TextBox2" ErrorMessage="Emailid cannot be left blank" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic"   
                ControlToValidate="TextBox2" ErrorMessage="Enter correct mailid" 
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>

The code behind part:


     protected void emailavail(object sender, EventArgs e)
{
    SqlConnection con = new SqlConnection();
    con.ConnectionString = "Data Source=DB-SERVER-PC\\NET3USER;Initial Catalog=prakash;User Id=sa;Password=strongsa;";
    con.Open();
    SqlCommand com = new SqlCommand("Select Emailid from details1 where Emailid=@email", con);
    com.Parameters.AddWithValue("@email", TextBox2.Text);

    SqlDataReader dr;
    dr = com.ExecuteReader();
    if (dr.Read() == true)
    {
        lblHelloWorld.Text = "Email not available";
    }
    else
    {
        lblHelloWorld.Text = "Email available"; 
    }
}

so my problem here is that once i enter mailid into textbox the validator is still there it is not leaving. If i remove autopostback property my validator is working fine but my ajax label is not displayed.
Please help me with this query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:16:24+00:00Added an answer on June 8, 2026 at 7:16 pm

    In case when AutoPostBack is disabled, you need other control inside your update panel for raise async postback to server

    Place a button after your textbox, for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code <div id=AuthenticateUser runat=server style=display:block > //login control <asp:button id=ValidateUser ...
My code is : <asp:TreeView ID=TreeViewCategories runat=server ExpandDepth=0 Style=min-height: 200px; max-height: 500px; LineImagesFolder=~/TreeLineImages NodeIndent=0
I have following code inside my ListView template. <asp:DropDownList runat=server ID=myDropDown Width=60px SelectedValue='<%# Eval(SelectedValue)
In a web2py view, how do I comment out server-side code? In ASP.NET, I
We're seeing this exception occur in the following block of code in an ASP.NET
Given the code block below (source: http://www.asp.net/learn/mvc/tutorial-31-cs.aspx )... I receive this error: Using the
I'm using the following code block to call a SQL Server 2005 stored procedure.
Screenshot of the page ASPX CODE <div style=width:729px;background:white;> <div id=tabs> <div><asp:LinkButton ID=LinkButtonDefinitions runat=server>Definitions</asp:LinkButton></div> <div><asp:LinkButton
The following code block allows the user creates textbox controls dynamically. However, on each
Given the following simplified code block in ASP.NET <% foreach( item in Model) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.