Search code examples
asp.netwebformscreateuserwizard

ASP.NET Not Recognizing Added Wizard Step


So I'm adding a step to the basic register user Wizard on the default register.aspx page in ASP.NET. I added the step into the markup and everything looks right, but when I load up the page in Chrome/IE, that step isn't showing up after i complete the first step. All i changed in the first, default step was the button (to make it say "Next"), but when i click that it just completes the form and redirects to default.aspx - never loading that second step.

Here's my markup (I removed some of the generic stuff that i didn't touch for readability's sake)

UPDATE: I redid the wizard from scratch (deleted and added a new one) and added one step in via markup. Now, when i view the page, i see the first step (and the "next" button reads "create user"). I fill it out and hit "create user" and i see the same step, except this time the button says "next"... i fill it out again and hit next and see the second step. fill that out and hit finish and all goes as planned.

<asp:CreateUserWizard ID="RegisterUser" runat="server"  OnFinishButtonClick="RegisterUser_CreatedUser">
    <WizardSteps>
        <asp:WizardStep runat="server" StepType="Start">
            /*Generic Stuff */
            </asp:WizardStep>
        <asp:WizardStep ID="personalinfo" runat="server" StepType="Auto" >
         /* Custom Wizard Step Content */
        </asp:WizardStep>

    </WizardSteps>
</asp:CreateUserWizard>

So basically, that middle step gets skipped. I hit the "Next" button on step 1 and it just completes the wizard. Here's my Code Behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Account_Register : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
    }


    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

        string continueUrl = RegisterUser.ContinueDestinationPageUrl;
        if (String.IsNullOrEmpty(continueUrl))
        {
            continueUrl = "~/";
        }
        // My Custom Stuff Here
        Response.Redirect(continueUrl);
    }

}

Thanks! Let me know if i need to provide any more info...(not that there's anything more to provide...)


Solution

  • You have a button in each wizard item. This is causing the page to submit. You should have a navigation bar as part of the Wizard that will navigate back & forth.....

    The default registration wizard as part of a VS 2010 Web App only has one step so they put the button in the only step. However, you want to add a step. You'll need to work on the custom navigation to add the next buttons and your final submit.

    Here's a nice article on modifying a wizard.

    This link and this link are a little older but go into more specifically modifying the Create User wizard and are still relevant since very little has changed on this wizard.