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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:22:01+00:00 2026-06-01T01:22:01+00:00

In my application’s login control, I am showing a dialog window if the login

  • 0

In my application’s login control, I am showing a dialog window if the login failed. In this way:

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 {
        ClientScript.RegisterStartupScript(typeof(ScriptManager), "CallShowDialog", "showDialog();", true);         
    }
}

The JavaScript is:

function showDialog() {
    $(document).ready(function () {
        $(".jym").dialog("open");
    });
}

Now if the login failed the dialog is showing. But The problem is if I refresh the browser window, after one login failed, the dialog again opened, since the $(".jym").dialog("open") is written in the page. Then I have tried

protected void Page_Unload(object sender, EventArgs e) {        
    log.Info("=============INSIDE Page_Unload======");
    ClientScript.RegisterStartupScript(typeof(ScriptManager), "CallShowDialog", "", true);
}

But no luck.

Is there any way to solve this problem?


If I use ClientScript.RegisterClientScriptBlock() this not working, I mean the dialog is not opening on error.

  • 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-01T01:22:02+00:00Added an answer on June 1, 2026 at 1:22 am

    Try calling the function:

    ClientScript.RegisterStartupScript(typeof(ScriptManager), "CallShowDialog", "", true);
    

    …in the Page_Load event handler.

    Page_Load occurs before the button click event handler. You can verify this by adding the following code and looking in the debug/output window:

    protected void Page_Load(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("Page_Load");   
    }
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("Button1_Click");      
    }
    

    So erasing the script in the Page_Load event handler should clear any previous script that was loaded.

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

Sidebar

Related Questions

Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Application stores configuration data in custom section of configuration file. This information is used
Application Specific Information: com.oneorangetree.iphoneexample failed to launch in time elapsed total CPU time (seconds):
Application: This is a workshop proposal system for a conference. A user can create
Application settings in Windows Forms is a convenient way to store application-wide properties. However,
Application.Run(form); Actually I tried to call this from my project. I got this exception.
Application.Run(new Main()); This line gives TypeInitializationException was unhandled after I switched from 3.5 to
Application failed codesign verification. The signature was invalid, or it was not signed with
Application crash due to this reason -[NSConcreteValue doubleValue]: unrecognized selector sent to Following code
Application use NHibernate. I Have object A that contains set of objects B. I

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.