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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:48:00+00:00 2026-05-31T23:48:00+00:00

In my page I have a login control: <asp:Login ID=EMSLogin runat=server OnAuthenticate=EMSLogin_Authenticate> <LayoutTemplate> <asp:Panel

  • 0

In my page I have a login control:

<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>

I have added the ScriptManager control to the page.

Now the EMSLogin_Authenticate is:

protected void EMSLogin_Authenticate(object sender, AuthenticateEventArgs e) {
    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 {
       Page.ClientScript.RegisterClientScriptBlock(typeof(ScriptManager), "CallShowDialog", "showDialog();", true);     
    }
}

The JavaScript method showDialog(); is defined in the page:

<script type="text/javascript">
    function showDialog() {
        $(".jym").dialog("open");
        return false;
    }   
</script>

But it is not calling. There is nothing wrong with showDialog() since I have called it on the onclick method of an anchor tag; it is showing the dialog. If I write alert() in place of showDialog() in code behind then I can see the alert message.

What I am doing wrong? Is it not possible to call JavaScript in this way?


This is also not working:

System.Web.UI.ScriptManager.RegisterClientScriptBlock(this.Page, typeof(RadButton), Guid.NewGuid().ToString(), "showDialog();", true);
  • 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-31T23:48:00+00:00Added an answer on May 31, 2026 at 11:48 pm

    The RegisterClientScriptBlock put the code before the document, so by the time you are calling the function, there is no element with class jym just yet. You can add alert($(".jym").length) to confirm that, you’ll see 0.

    Why not calling the function from client side?

    $(document).ready(function() {
        showDialog();
    });
    

    If you need it server side, just change your code to:

    if (Membership.ValidateUser(UserName.Text, Password.Text)) {
       FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
    } else {
       Page.ClientScript.RegisterClientScriptBlock(typeof(ScriptManager), "CallShowDialog", "$(document).ready(function() { showDialog(); });", true);     
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Update panel in Master page: <asp:ScriptManager id=CartScript runat=server></asp:ScriptManager> <asp:UpdatePanel id=CartBox runat=server updateMode=Conditional>
I have an ASP.NET login control on a page, with the Remember Me checkbox
I have a simple, single-page in ASP.NET (C#). I wanted to add login control,
I have an ASP.net Login Control which has a link to CreateUserWizard page(register). When
I am using asp.net. I have a login page. I use this control in
I have an ASP Login control box on the page which is customized. Inside
I have a login control in an asp.net page. On MSDN it is specified
I have an ASP.NET web page with a Login control on it. When I
I have a createuserwizard and a login control on a page. both of them
I have a login page written in classic asp. I want to set the

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.