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

  • Home
  • SEARCH
  • 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 7692905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:57:36+00:00 2026-05-31T20:57:36+00:00

I am having trouble to find a solution to stop form submission on click

  • 0

I am having trouble to find a solution to stop form submission on click of the browser’s refresh button.

This is the Login form I have:

<asp:Login ID="EMSLogin" runat="server" OnAuthenticate="EMSLogin_Authenticate">
    <LayoutTemplate>
        <asp:Panel ID="Panel1" runat="server" CssClass="wrapper">
            <asp:Panel ID="Panel2" runat="server" CssClass="holder">
                <asp:Panel ID="Panel3" runat="server" CssClass="loginBox one_edge_shadow">
                    <h1>
                        Login Credentials</h1>
                    <asp:Panel ID="Panel4" runat="server" CssClass="name topmargin">
                        <asp:Panel ID="Panel5" runat="server" CssClass="label">
                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
                        </asp:Panel>
                        <asp:Panel ID="Panel6" runat="server" CssClass="textBox">
                            <telerik:RadTextBox ID="UserName" runat="server" Height="16px" Width="165px" Font-Size="14px"
                                Font-Names="Arial Sans-Serif" ToolTip="Enter your valid login name" />
                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                ValidationGroup="EMSLogin">*</asp:RequiredFieldValidator>
                        </asp:Panel>
                        <br class="clearfix" />
                    </asp:Panel>
                    <asp:Panel ID="Panel7" runat="server" CssClass="name topmargin">
                        <asp:Panel ID="Panel8" runat="server" CssClass="label">
                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                        </asp:Panel>
                        <asp:Panel ID="Panel9" runat="server" CssClass="textBox">
                            <telerik:RadTextBox ID="Password" runat="server" TextMode="Password" Height="16px"
                                Width="165px" Font-Size="14px" Font-Names="Arial Sans-Serif" ToolTip="Enter your valid password" />
                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                ValidationGroup="EMSLogin">*</asp:RequiredFieldValidator>
                        </asp:Panel>
                        <br class="clearfix" />
                        <telerik:RadButton ID="LoginButton" runat="server" CommandName="Login" Text="Log In"
                            CssClass="loginButton" Font-Size="14px" Width="100px" ValidationGroup="EMSLogin"
                            ToolTip="Click to log in" />
                    </asp:Panel>
                </asp:Panel>
            </asp:Panel>
        </asp:Panel>
    </LayoutTemplate>
</asp:Login>

And in the backend:

protected void Page_Load(object sender, EventArgs eventArgs) {
    log.Info("=============INSIDE Page_Load======");
    DataBind();
    LoginErrorWindow.VisibleOnPageLoad = false;     
}

protected void EMSLogin_Authenticate(object sender, AuthenticateEventArgs e) {
    log.Info("=============INSIDE EMSLogin_Authenticate======");
    RadTextBox UserName = EMSLogin.FindControl("UserName") as RadTextBox;
    RadTextBox Password = EMSLogin.FindControl("Password") as RadTextBox;

    if (Membership.ValidateUser(UserName.Text, Password.Text)) {
    FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
    } else {
    LoginErrorWindow.NavigateUrl = EMSApplication.Web.Utils.NavigationUtils.GetLoginErrorDialogURL();
    LoginErrorWindow.VisibleOnPageLoad = true;
    }
}

Now after one login failed if I press the refresh button the method EMSLogin_Authenticate is executing again. And before reload it is showing:

enter image description here

How can I solve this?

  • 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-31T20:57:37+00:00Added an answer on May 31, 2026 at 8:57 pm

    Do a Response.Redirect to an error page after the login has failed.

    See the PRG pattern on Wikipedia.

    Post/Redirect/Get (PRG) is a web development design pattern that prevents some duplicate form submissions, creating a more intuitive interface for user agents (users). PRG implements bookmarks and the refresh button in a predictable way that does not create duplicate form submissions.

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

Sidebar

Related Questions

I am having trouble trying to find a solution for this, without resorting to
I'm having trouble implementing a functionality on my c#/asp.net app. I have a form
I have some trouble to find a css solution for having an active anchor
I found this snippet of code I am having trouble trying to find a
I'm having some trouble with an SQL statement that have to find the number
I'm having trouble finding the right solution for this fully fluid layout. I want
Having trouble finding a solution for my situation here. Sorry if this has been
I've inherited an asp.net 3.5 solution and I'm having trouble getting it working. I
I'm having trouble getting the latest data out of this. I have a table
I am having trouble to find the cybervillainsCA certificate file in Selenium-Server-2.20 zip file

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.