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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:52:47+00:00 2026-05-11T06:52:47+00:00

I am rather confused I have got a createuser wizard control that I use

  • 0

I am rather confused I have got a createuser wizard control that I use with my custom user classes and role classes.

I have a step so that the admin user can create new users and assign them their roles. The OnActivate method is firing but the OnDeactivate is not. I have put break points on both methods and confirmed that it is not going into the method at all. I have included both the markup and code behind below, (sorry it is a bit long I did not want to cut anything out incase that was the problem):

<asp:Content ID='Content1' ContentPlaceHolderID='ContentPlaceHolder1' runat='Server'> <asp:CreateUserWizard ID='CreateUserWizard1' runat='server' ContinueDestinationPageUrl='~/admin/default.aspx'     DisableCreatedUser='false' Font-Names='Verdana' BackColor='white' Font-Size='10pt'     BorderWidth='1px' BorderColor='#CCCC99' BorderStyle='Solid' CompleteSuccessText='The account has been successfully created.'     UnknownErrorMessage='The account was not created. Please try again.'>     <WizardSteps>         <asp:CreateUserWizardStep ID='CreateUserWizardStep2' runat='server' Title='Step 1: Basic User Information'             OnDeactivate='UpdateCurrentLvl_OnDeactivate'>             <ContentTemplate>                 <table style='font-size: 10pt; font-family: Verdana' border='0' width='400'>                     <tr>                         <td style='font-weight: bold; color: white; background-color: #6b696b' align='center'                             colspan='2'>                             Create Your UserID                         </td>                     </tr>                     <tr>                         <td align='right'>                             <asp:Label ID='UserNameLabel' runat='server' AssociatedControlID='UserName'>UserID:</asp:Label></td>                         <td>                             <asp:TextBox ID='UserName' runat='server'></asp:TextBox>                             <asp:RequiredFieldValidator ID='UserNameRequired' runat='server' ToolTip='User Name is required.'                                 ErrorMessage='User Name is required.' ValidationGroup='CreateUserWizard1' ControlToValidate='UserName'>                                     *</asp:RequiredFieldValidator>                         </td>                     </tr>                     <tr>                         <td align='right'>                             <asp:Label ID='PasswordLabel' runat='server' AssociatedControlID='Password'>Password:</asp:Label></td>                         <td>                             <asp:TextBox ID='Password' runat='server' TextMode='Password'></asp:TextBox>                             <asp:RequiredFieldValidator ID='PasswordRequired' runat='server' ToolTip='Password is required.'                                 ErrorMessage='Password is required.' ValidationGroup='CreateUserWizard1' ControlToValidate='Password'>                                     *</asp:RequiredFieldValidator>                         </td>                     </tr>                     <tr>                         <td align='right'>                             <asp:Label ID='ConfirmPasswordLabel' runat='server' AssociatedControlID='ConfirmPassword'>Re-Type Password:</asp:Label>                         </td>                         <td>                             <asp:TextBox ID='ConfirmPassword' runat='server' TextMode='Password'></asp:TextBox>                             <asp:RequiredFieldValidator ID='ConfirmPasswordRequired' runat='server' ToolTip='Confirm Password is required.'                                 ErrorMessage='Confirm Password is required.' ValidationGroup='CreateUserWizard1'                                 ControlToValidate='ConfirmPassword'>                                     *</asp:RequiredFieldValidator>                         </td>                     </tr>                     <tr>                         <td align='right'>                             <asp:Label ID='EmailLabel' runat='server' AssociatedControlID='Email'>Email:</asp:Label>                         </td>                         <td>                             <asp:TextBox ID='Email' runat='server'></asp:TextBox>                                                         </td>                     </tr>                 </table>                 <br />                 <br />                 <table style='font-size: 10pt; font-family: Verdana' border='0' width='400'>                     <tr>                         <td style='font-weight: bold; color: white; background-color: #6b696b' align='center'                             colspan='2'>                             If You Forget Your Password                         </td>                     </tr>                     <tr>                         <td align='right'>                             Security Question:                         </td>                         <td>                             <asp:DropDownList ID='Question' runat='server' Width='200'>                                 <asp:ListItem Text='[Select a Question]' />                                 <asp:ListItem Text='Favorite Pet' />                                 <asp:ListItem Text='Mother's Maiden Name' />                                 <asp:ListItem Text='Who was your childhood hero?' />                                 <asp:ListItem Text='Your favorite pasttime?' />                             </asp:DropDownList>                             <asp:RequiredFieldValidator ID='QuestionRequired' runat='server' InitialValue='[Select a Question]'                                 ControlToValidate='Question' ErrorMessage='Select a Security Question' ValidationGroup='CreateUserWizard1'>*</asp:RequiredFieldValidator>                         </td>                     </tr>                     <tr>                         <td align='right' width='170'>                             Your Answer:                         </td>                         <td>                             <asp:TextBox ID='Answer' runat='server'></asp:TextBox>                             <asp:RequiredFieldValidator ID='AnswerRequired' runat='server' ControlToValidate='Answer'                                 ErrorMessage='RequiredFieldValidator' ValidationGroup='CreateUserWizard1'>*</asp:RequiredFieldValidator>                         </td>                     </tr>                 </table>                 <br />                 <br />                 <table style='font-size: 10pt; font-family: Verdana' border='0' width='400'>                     <tr>                         <td style='font-weight: bold; color: white; background-color: #6b696b' align='center'                             colspan='2'>                             Help Us Customize Your Experience                         </td>                     </tr>                     <tr>                         <td align='right' width='170'>                             Set Level of the user:</td>                         <td>                             <asp:DropDownList ID='cLevel' runat='server'>                                 <asp:ListItem Text='[Select a Level]' />                                 <asp:ListItem Text='1' />                                 <asp:ListItem Text='2' />                                 <asp:ListItem Text='3' />                             </asp:DropDownList>                             <asp:RequiredFieldValidator ID='RequiredFieldValidator1' runat='server' InitialValue='[Select a Level]'                                 ControlToValidate='cLevel' ErrorMessage='Select a Level' ValidationGroup='CreateUserWizard1'>*</asp:RequiredFieldValidator>                         </td>                     </tr>                     <tr>                         <td align='center' colspan='2'>                             <asp:CompareValidator ID='PasswordCompare' runat='server' ErrorMessage='The Password and Confirmation Password must match.'                                 ValidationGroup='CreateUserWizard1' ControlToValidate='ConfirmPassword' ControlToCompare='Password'                                 Display='Dynamic'>                             </asp:CompareValidator>                         </td>                     </tr>                     <tr>                         <td style='color: red' align='center' colspan='2'>                             <asp:Literal ID='ErrorMessage' runat='server' EnableViewState='False'></asp:Literal>                         </td>                     </tr>                 </table>             </ContentTemplate>         </asp:CreateUserWizardStep>         <asp:WizardStep runat='server' ID='wsAssignUserToRoles' AllowReturn='False' Title='Step 2: Assign User To Roles'             OnActivate='AssignUserToRoles_Activate' OnDeactivate='AssignUserToRoles_Deactivate'>             <table>                 <tr>                     <td>                         Select one or more roles for the user:</td>                 </tr>                 <tr>                     <td>                         <asp:ListBox ID='AvailableRoles' runat='server' SelectionMode='Multiple' Height='104px'                             Width='264px'></asp:ListBox>                     </td>                 </tr>             </table>         </asp:WizardStep>         <asp:CompleteWizardStep ID='CompleteWizardStep2' runat='server'>         </asp:CompleteWizardStep>     </WizardSteps>     <TitleTextStyle Font-Bold='True' BackColor='#6B696B' ForeColor='White'></TitleTextStyle> </asp:CreateUserWizard> 

The code behind is:

public partial class admin_createuser : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {  }  protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) {     // Create an empty Profile for the newly created user     ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);      // Populate some Profile properties off of the create user wizard     p.CurrentLevel = Int32.Parse(((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl('clevel')).SelectedValue);      // Save profile - must be done since we explicitly created it     p.Save(); }  // Activate event fires when the user hits 'next' in the CreateUserWizard public void AssignUserToRoles_Activate(object sender, EventArgs e) {     // Databind list of roles in the role manager system to a listbox in the wizard     AvailableRoles.DataSource = Roles.GetAllRoles(); ;     AvailableRoles.DataBind(); }  // Deactivate event fires when user hits 'next' in the CreateUserWizard  public void AssignUserToRoles_Deactivate(object sender, EventArgs e) {     // Add user to all selected roles from the roles listbox     for (int i = 0; i < AvailableRoles.Items.Count; i++)     {         if (AvailableRoles.Items[i].Selected == true)             Roles.AddUserToRole(CreateUserWizard1.UserName, AvailableRoles.Items[i].Value);     } }  //set the user level to the value set in the form as it has been inserted into the DB at this point. public void UpdateCurrentLvl_OnDeactivate(object sender, EventArgs e) {     int level = Int32.Parse(((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl('clevel')).SelectedValue);     MyMembershipUser myUser = (MyMembershipUser)Membership.GetUser(CreateUserWizard1.UserName);     myUser.CurrentLVL = level;     Membership.UpdateUser(myUser); } 

}

  • 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. 2026-05-11T06:52:48+00:00Added an answer on May 11, 2026 at 6:52 am

    Well I seem to have found ‘an’ answer… no idea why this would be the case.

    I had the create user wizard page under /admin/createuser.aspx. When I put this in the root of the website ie.. /createuser.aspx it all worked!!!!

    can’t explain it but it seemed to fix the problem.. very odd!

    ….. edit

    I spoke too soon. It seems to be a permissions thing. I think it wants to log me (the user who is creating another account) out and log in the new user, who is not in any groups yet. This means they can not access any page that has security on it in the web.config which mine do.

    question is how can I stop the person being logged out and give the new user permissions?

    My ultimate solution was to use this statement in the CreateUserWizard control:

    LoginCreatedUser='false' 

    It simply stopped the user from being logged in and removed any worries of the permissions issues as the currently logged in user had to have permissions for that page in the first place.

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

Sidebar

Ask A Question

Stats

  • Questions 110k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you need flash, you might want to inspect this… May 11, 2026 at 9:37 pm
  • Editorial Team
    Editorial Team added an answer You can use CSS Friendly Control Adapters to alter the… May 11, 2026 at 9:37 pm
  • Editorial Team
    Editorial Team added an answer Use the -Werror flag. It's not listed in the -help… May 11, 2026 at 9:37 pm

Related Questions

I am confused about authentication with BlazeDS. Most of the few examples I have
I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess
Ok, so I just ran into the following problem that raised an eyebrow. For
I am in the process of designing a build system and the directory structure

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.