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 6016773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:01:53+00:00 2026-05-23T03:01:53+00:00

Hi Below is the code i m using for login page.but it does not

  • 0

Hi
Below is the code i m using for login page.but it does not enter to button click.and when i tried to put new button, its button click event opens in aspx page.
I m not getting where exactly the problem is.

protected void btnSubmit_Click(object sender, EventArgs e)
{
    string password = "";
    string query = "select AdminPwd from tbladminlogin where AdminId='" + txtUserName.Text + "'";
    MySqlConnection objMyCon = new MySqlConnection(strProvider);
    objMyCon.Open();
    MySqlCommand cmd = new MySqlCommand(query, objMyCon);
    MySqlDataReader r = cmd.ExecuteReader();
    while (r.Read())
    {
        password = r[0].ToString();
    }
    if (password == "")
    {
        Session["Login"] = false;
        lblMessage.Visible = true;
        lblMessage.Text = "Invalid Username";
        txtUserName.Text = "";
        txtPwd.Text = "";
    }
        // 
    else
    {
        if (txtPwd.Text == password)
        {
            Session["Login"] = true;
            Session["UserName"] = txtUserName.Text;

            Response.Redirect("concertDetail.aspx");
        }
        else if (txtPwd.Text != password)
        {
            Session["Login"] = false;
            lblMessage.Visible = true;
            lblMessage.Text = "Invalid Password";
            txtPwd.Text = "";
        }
    }
    objMyCon.Close();
}

//aspx page

<div id="login">
    <%--<div class="response-msg success ui-corner-all">
                        <span>Success message</span>
                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit
                    </div>--%>
    <asp:Label ID="lblMessage" runat="server" Text="Label" Font-Size="Medium" ForeColor="Red"></asp:Label>
    <form id="Form1" runat="server">
    <ul>
        <li>
            <label for="email" class="desc">
                Username:
            </label>
            <div>
                <%--<input type="text" tabindex="1" maxlength="255" value="" class="field text full" name="email" id="email" />--%>
                <asp:TextBox ID="txtUserName" runat="server" MaxLength="255" Width="470px"></asp:TextBox>
            </div>
        </li>
        <li>
            <label for="password" class="desc">
                Password:
            </label>
            <div>
                <%--<input type="text" tabindex="1" maxlength="255" value="" class="field text full" name="password" id="password" />--%>
                <asp:TextBox ID="txtPwd" runat="server" MaxLength="255" Width="470px"></asp:TextBox>
            </div>
        </li>
        <li class="buttons">
            <div style="position: relative; top: -4px; left: 408px; width: 67px; height: 32px;">
                <div style="position: relative;">
                </div>
                <%--<button class="ui-state-default ui-corner-all float-right ui-button" onclick="btnSubmit_Click" type="submit">Login</button>--%>
                <asp:Button ID="btnSubmit" runat="server" Text="Login" OnClick="btnSubmit_Click" />
            </div>
        </li>
    </ul>
</form>

  • 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-05-23T03:01:54+00:00Added an answer on May 23, 2026 at 3:01 am

    The onclick event below searches for a function “btnSubmit_Click” in javascript and not code-behind, since the button is an html control:

    <button class="ui-state-default ui-corner-all float-right ui-button" onclick="btnSubmit_Click" type="submit">Login</button>
    

    As for as the asp:Button is concerned, it should work. There doesn’t seem to be any problem in it. Please check that the ASP.NET Development server is not already running. Next clear your cache and check if debugging is enabled in your browser.

    As far as the double click issue is concerned, you should disable it. The best solution to this, in my knowledge is to deal with it on client-side like this:

    <script>
        var reqSubmitted = false;
        function submitRequest() {
            if (!reqSubmitted) {
                reqSubmitted = true;
                return reqSubmitted;
            }
            reqSubmitted = false;
            return reqSubmitted;
        }
    </script>
    

    ………………………………….

    <form id="Form1" runat="server" onsubmit="return submitRequest()">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the code snippet below, however it's not working quite as I
The code below is the code i am using. It works fine in thunderbird
Using the code below, I am returning an nvarchar field from MS SQL 2005
I am using the code below to save and restore the window position and
I have the below code in stdafx.h. using namespace std; typedef struct { DWORD
In the code below I am using a recursive CTE(Common Table Expression) in SQL
If I am using a tree structure of nodes similar to the code below,
I'm using this code, and I get the stack trace that is listed below.
I am using the code below to populate a select list from fields in
I'm trying to connect to a website (source code below) that requires login and

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.