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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:44:49+00:00 2026-05-30T09:44:49+00:00

I have a simple ASP.Net login page. When the login button is clicked, the

  • 0

I have a simple ASP.Net login page. When the login button is clicked, the page should post back and the even should be handled by my server-side event handler. Instead, the page simply reloads. Page.IsPostBack is false.

I’ve put breakpoints in the Page_Load/Init (where applicable) handlers of the Master page, the ASPX page and the UserControl (ascx). When I hit the Login button, instead of getting a post back and having my event handler called, I simply get the page load as if it was a fresh request.

But that’s not the end of it! The login page takes a single query string parameter: Login.aspx?id=123456. The above failure occurs when using this parameter. However, if I enable URL Rewriting in order to make the query Login/123456, the error does not occur; I get a post back and my event handler is called in this instance.

So why am I not getting the expected behaviour from my page? What about the rewritten URL is making the problem go away?

Login Button is declared in LoginUserControl.ascx:

<asp:Button ID="SubmitLinkButton" runat="server" Text='Log In' OnClick="SubmitLinkButton_Click"></asp:Button>

And the handler in the code behind:

protected void SubmitLinkButton_Click(object sender, EventArgs e)
{
    Authenticate();
}

SubmitLinkButton_Click is never called. 🙁

Edit (more code):

//Page_Init on the Master page
protected void Page_Init(object sender, EventArgs e)
{

    if (HttpContext.Current.User.Identity.IsAuthenticated) 
    {
        try
        {

            if (SessionFacade.User != null)
            {
                loginlabel.Text = "Logged in |";
                LoginLink.Visible = true;
            }
        }
        catch
        {
            FormsAuthentication.SignOut();
            CacheFacade.RemoveSessionValues();
            Session.Abandon();
            Session.RemoveAll();
            HttpContext.Current.Response.Redirect("~/Login.aspx");
        }
    }
    else
    {
        loginlabel.Text = "";
        LoginLink.Visible = false;
    }
}

Page_Load on the ASPX page:

protected void Page_Load(object sender, EventArgs e)
{
    if (this.IsPostBack.Equals(false))
    {
        /* Some business stuff that boils down to this: */
        Session["company"] = Request["company"];
    }
}

Page_Load on the Login Control:

protected void Page_Load(object sender, EventArgs e)
{

    if (!Page.IsPostBack)
    {
        //honestly, there's no code here
    }

}

P.S: I need to keep the non-url-rewrite way of accessing the login page, because many users are still navigating to that URL.

P.P.S: Even if URL rewriting isn’t enabled, the error still occurs.

  • 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-30T09:44:50+00:00Added an answer on May 30, 2026 at 9:44 am

    Whenever I’ve seen this problem in the past it has usually been attributed to URL re-writing. I would usually reach for Fiddler to trace the HTTP activity. My hunch tells me after you click the button and see the POST request it will quickly be followed up by a 302 redirect to the login page.

    You note that “The above failure occurs when using this parameter” of the login.aspx page. Are you certain there is no url-rewriter configuration that for example, may strip out any querystring values and do a redirect?

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

Sidebar

Related Questions

I have a simple, single-page in ASP.NET (C#). I wanted to add login control,
I have created a simple login page for asp.net which takes in user name
I have simple asp.net webservice has login method and its deployed on IIS server
I have a very simple ASP.Net page that acts as a front end for
I have created a simple members database in ASP.NET with login and create account
I have a simple ASP.NET page where after the initial page load the user
I have a simple three page asp.net webforms site and having an issue with
I have a simple ASP.NET 3.5 SP1 Web Forms app... I've added the System.Web.Routing
Let's say I have a simple ASP.NET MVC blog application and I want to
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file 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.