Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > newbie: Problem with CreateUserWizard

Reply
Thread Tools

newbie: Problem with CreateUserWizard

 
 
Jeff
Guest
Posts: n/a
 
      02-08-2007
Hey

Below is the source code of the CreateUserWizard placed on one my web pages
(asp.net 2.0).

The problem is that the AssignUserToRole method isn't triggered when
clicking on the finish button (that Images/Go.gif image).

So I'm wondering what I'm doing wrong here

******************* markup ********************
<asp:CreateUserWizard FinishDestinationPageUrl="~/Default.aspx"
ID="CreateUserWizard1"
Width="300px" runat="server"
LoginCreatedUser="false"
CreateUserButtonType="Image"
CreateUserButtonImageUrl="Images/Go.gif"
OnFinishButtonClick="AssignUserToRole">

<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<label for="Username">User name:</label>
<asp:TextBox id="Username" runat="server" />

<label for="Password">Password:</label>
<asp:TextBox id="Password" runat="server"
TextMode="Password" />

<label for="ConfirmPassword">Confirm
Password:</label>
<asp:TextBox id="ConfirmPassword" runat="server"
TextMode="Password" />

<label for="Email">Email</label>
<asp:TextBox id="Email" runat="server" />

<label for="Question">Security question:</label>
<asp:TextBox id="Question" runat="server" />

<label for="Answer">Security answer:</label>
<asp:TextBox id="Answer" runat="server" />


</ContentTemplate>
</asp:CreateUserWizardStep>

<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
<ContentTemplate>rrrr</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>

***************** AssignUserToRole code **********************
protected void AssignUserToRole(object sender, EventArgs e)
{
MembershipUser user = Membership.GetUser();
user.IsApproved = false;
MailMessage mail = new MailMessage("(E-Mail Removed)", user.Email,
"Thank you", "Hello World");
SmtpClient smtpClient = new SmtpClient();
smtpClient.Send(mail);
mail.Dispose();
}

Any suggestions?


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      02-08-2007
I put the functionality into the CreatedUser event

Jeff


"Jeff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hey
>
> Below is the source code of the CreateUserWizard placed on one my web
> pages (asp.net 2.0).
>
> The problem is that the AssignUserToRole method isn't triggered when
> clicking on the finish button (that Images/Go.gif image).
>
> So I'm wondering what I'm doing wrong here
>
> ******************* markup ********************
> <asp:CreateUserWizard FinishDestinationPageUrl="~/Default.aspx"
> ID="CreateUserWizard1"
> Width="300px" runat="server"
> LoginCreatedUser="false"
> CreateUserButtonType="Image"
> CreateUserButtonImageUrl="Images/Go.gif"
> OnFinishButtonClick="AssignUserToRole">
>
> <WizardSteps>
> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
> <ContentTemplate>
> <label for="Username">User name:</label>
> <asp:TextBox id="Username" runat="server" />
>
> <label for="Password">Password:</label>
> <asp:TextBox id="Password" runat="server"
> TextMode="Password" />
>
> <label for="ConfirmPassword">Confirm
> Password:</label>
> <asp:TextBox id="ConfirmPassword"
> runat="server" TextMode="Password" />
>
> <label for="Email">Email</label>
> <asp:TextBox id="Email" runat="server" />
>
> <label for="Question">Security
> question:</label>
> <asp:TextBox id="Question" runat="server" />
>
> <label for="Answer">Security answer:</label>
> <asp:TextBox id="Answer" runat="server" />
>
>
> </ContentTemplate>
> </asp:CreateUserWizardStep>
>
> <asp:CompleteWizardStep ID="CompleteWizardStep1"
> runat="server">
> <ContentTemplate>rrrr</ContentTemplate>
> </asp:CompleteWizardStep>
> </WizardSteps>
> </asp:CreateUserWizard>
>
> ***************** AssignUserToRole code **********************
> protected void AssignUserToRole(object sender, EventArgs e)
> {
> MembershipUser user = Membership.GetUser();
> user.IsApproved = false;
> MailMessage mail = new MailMessage("(E-Mail Removed)", user.Email,
> "Thank you", "Hello World");
> SmtpClient smtpClient = new SmtpClient();
> smtpClient.Send(mail);
> mail.Dispose();
> }
>
> Any suggestions?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with extending CreateUserWizard control Mich ASP .Net 0 01-27-2008 10:21 PM
Problem with CreateUserWizard frank ASP .Net Security 0 12-21-2007 01:37 AM
problem with Maildefinition in CreateUserWizard Bob ASP .Net 0 05-18-2007 04:41 PM
Problem with CreateUserWizard =?Utf-8?B?R3V5?= ASP .Net 0 03-09-2006 07:41 AM
CreateUserWizard problem, what goes wrong? =?Utf-8?B?R3V5?= ASP .Net 0 03-08-2006 04:21 PM



Advertisments