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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:33:08+00:00 2026-05-20T15:33:08+00:00

I have written a simple jQuery dialog box that will appear in an asp

  • 0

I have written a simple jQuery dialog box that will appear in an asp panel if the logged in user has not reset their password in the last 90 days. This is working great, however when the user types in their password and presses submit to insert the new password into the database, the parent page is posting back before the click event is fired on the user control.

Here is how it is set up:

default.aspx

 <asp:Panel ID="pnlTest" runat="server" Visible="false">
    <div id="dialog" title="Password must be reset">
        <cms:ResetPassword runat="server" ID="reset" />
    </div>
 </asp:Panel>

ResetPassword.ascx:

<div style="overflow:auto; white-space:nowrap;">
    <table class="tableChangePassword">
        <tr>
            <td>Current Password</td>
            <td colspan="2"><asp:TextBox runat="server" ID="txtCurrentPass" TextMode="Password" /></td>
        </tr>
        <tr>
            <td>New Password</td>
            <td><asp:TextBox runat="server" ID="txtNewPass1" TextMode="Password" CssClass="newPass1" /></td>
        </tr>
        <tr>
            <td>Verify New Password</td>
            <td><asp:TextBox runat="server" ID="txtNewPass2" TextMode="Password" CssClass="newPass2" /></td>
        </tr>
        <tr>
            <td colspan="2">
            </td>
        </tr>
        <tr>
            <td colspan="3"><asp:LinkButton runat="server" ID="lbUpdatePass" Text="Submit" onclick="lbUpdatePass_Click" /></td>
        </tr>
    </table>    
    <asp:Label runat="server" ID="lblMSG" />
</div>

ResetPassword Codebehind:

public partial class ResetPassword : UserControl
{
    protected void lbUpdatePass_Click(object sender, EventArgs e)
    {
        string newPass = txtNewPass1.Text;
        string confirmNewPass = txtNewPass2.Text;
        if (newPass == confirmNewPass)
        {
            MembershipUser user = AuthenticatedUser.GetMembershipProvider().GetUser(AuthenticatedUser.LoginUserID, false);
            if (user != null)
            {
                string resetPsw = user.ResetPassword();
                user.ChangePassword(resetPsw, newPass);
                lblMSG.Text = "Password Changed Successfully";
            }
        }
    }
}

Whenever I click the button to change the password, the default page is calling a postback and it is blanking out the text that was input to change the password, so when the click function gets called the strings come through as “” and it throws an 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-05-20T15:33:09+00:00Added an answer on May 20, 2026 at 3:33 pm

    I implemented what you have above in a test project, and it worked correctly. The lbUpdatePass_Click event had the correct values in each text property of the text boxes. Do you have code in the parent or child Page_Load events that are manipulating those text fields at all? Any other code that you are not displaying above?

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

Sidebar

Related Questions

I have written a simple jQuery.ajax function which loads a user control from the
I have written a simple jQuery script that changes the hash tag of a
I have written this simple bit of jQuery that swaps out the containing ul's
I have written a very simple script with jQuery, but it does not work
I am learning jQuery and I have written a very simple script that works
I have written some relatively simple jQuery plug-ins, but I am contemplating writing something
I have written a simple WCF service that accepts and stores messages. It works
I have written a simple CRUD form which has one select list. However the
I have written a very simple JQuery widget to handle fixed toolbars: (function($){ $.fn.stickytoolbar
I've written a simple ascx user control called myLight that I programtically add several

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.