views:

213

answers:

1

I'm using the asp.net CreateUserWizard control. I've added a WizardStep and need it to verify 3 datapoints against our internal database before allowing the user to create an account. However, when I try to wire the next button click to a codebehind method to check the data, the event never fires in the codebehind.

Below is the code on the Next button-

<asp:Button ID="StepNextButton" runat="server" BackColor="#FFFBFF" 
            BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" 
            CommandName="MoveNext" Font-Names="Verdana" ForeColor="#284775" 
            Text="Next" onclick="StepNextButton_Click1" />

Should it be wired this way? Does the Wizard give you a way to determine which step you're on so you're not checking for every step?

One more question. In order to effectively take advantage of Forms Based Auth and tracking if the user is curently logged in or not, it appears to me that all of the pages need to be wrapped in a LoginView control so if their session expires, they view the 'Not logged in' template view? Correct?

A: 

Simple partial answer: Hijack the onclick event to call your own function. Check against your DB and call StepNextButton_Click1 (make sure to pass appropriate caller and args for this) if all is well. Otherwise you can invalidate the page and/or redirect users.