I am using create user wizard, I want before creating user it should be verified with Captcha. I downloaded plugin from captcha's website & it works all fine without Create User Wizard. What I want is when user enter standard values like user name, password,
email, security question & answer, then it should also verify captcha image on same page. I added captcha control on createuser wizard by Customizing create user step. Now my Create user wizard is having 7 fields viz 1. user name, 2. password 3.confirm password,
4. Email 5. Security Question 6. Answer & 7. Captcha control. First 6 fields are validated by ASP.NET & for validating Captcha image. Page.IsValid method is required. I written this method in my code behind (C#) but I dont know how to call this method for
verification. I tried OnCreatedUser but it wont work neither OnCreatingUser. Please suggest how can I call method for to check Page.IsValid or not using Create User Wizard.
Below is the method I want to call before creating user :
protected void Submit_Click(object sender, EventArgs e)
{
if (Page.IsValid) {
Label1.Text = "Success";
//Go to next step
} else {
Label1.Text = "In-Correct";
//Stay at same page.
}
}
I written this method in my code behind (C#) but I dont know how to call this method for verification
H
I've answered a similar thread about adding captcha control to CreateUserWizard. You may check the validity of captcha in CreateUserWizard.ActiveStepChanged Event
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
First step verifies captcha & take me to create user step, but unfortunately user is not getting created after entering all valid information, nor i am getting any validation error.
there is no code-behind file. Please suggest if code behind needed ? if yes wat things are necessary to mention in code behind.
Is this possible to add captcha control in same step where I am asking username, password,email etc, if yes how?
First step verifies captcha & take me to create user step, but unfortunately user is not getting created after entering all valid information, nor i am getting any validation error.
there is no code-behind file. Please suggest if code behind needed ? if yes wat things are necessary to mention in code behind.
Hi
I suggest you check the validity of captcha in your customize CreateUserWizardStep, and redirect to the next step only if captcha Control returns true result, Since your captcha is third party control, so I cannot talk much about how to use this captcha.
instead, I suppose you will get this result and use this in code behind like the following code
protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 0) {
if (!CustomValidation()){
//some code here
e.Cancel = true;}
}
}
private bool CustomValidation()
{
return true; //find captcha control and retrieve result
}
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
There is no error in first step that is Captcha is getting validated by itself, & if I enter wrong value in captcha control wont go next step. If value is correct this allow me to go to next step & I can create user. But when I pass all valid values to fields
like User Name, Password, Confirm Password, Email, Security Ques. & Ans. This step doesnt create any account nor gives error. Please suggest where is the error. Thanks,
and then check ErrorMessage displaying on page, this may help you diagnose the cause of problem
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Thank you once again for providing very useful resource.
XiaoYong Dai – MSFT
For test purpose, what will happen if you use a new CreateUserWizard (without Captcha control)?
If I do not add captcha user creation works & user gets created.
btw , there was bug in captcha control I fixed that now.
For Reference :
<div>I modified the actual source for the RecaptchaControl. The best way to do this is if you have
VS.NET 2005/2008, create a solution with the RecaptchaControl (or download readymade from recaptcha website) project and your website. Then create a project reference to the RecaptchaControl in the website project.
Now update the source in the RecaptchaControl project .i.e. set the recaptchaResponse variable in the RecaptchaControl class to the default value of RecaptchaResponse.Valid.
</div> <div> </div> <div>Build the solution and the recaptcha control should start to behave when a ValidationSummary control is on the web page.</div><div> </div><div>Hopefully this will work.</div><div> </div><div>But I am not able to work this settings in
single step , that is by adding control to CreateUserWizard control. I have to make User Steps, in my case 1st step ask captcha verification & next asks user details. If someone gets this done in single step , please post there views. Any help is greatly appriciated.
</div><div> </div><div>Below are the references I used : </div><div> </div><div>http://recaptcha.net/plugins/aspnet/</div><div>http://aspnet.4guysfromrolla.com/articles/070506-1.aspx</div><div> </div><div>Thank you ,</div><div> </div><div>Many Regards,</div><div>-Sunny. </div><div> </div><div> </div><div> </div>
Marked as answer by sunny_popali on Jan 08, 2008 11:03 AM
sunny_popali
Member
37 Points
48 Posts
Create User Wizard with Captcha
Dec 29, 2007 07:23 AM|LINK
Hi ,
I am using create user wizard, I want before creating user it should be verified with Captcha. I downloaded plugin from captcha's website & it works all fine without Create User Wizard. What I want is when user enter standard values like user name, password, email, security question & answer, then it should also verify captcha image on same page. I added captcha control on createuser wizard by Customizing create user step. Now my Create user wizard is having 7 fields viz 1. user name, 2. password 3.confirm password, 4. Email 5. Security Question 6. Answer & 7. Captcha control. First 6 fields are validated by ASP.NET & for validating Captcha image. Page.IsValid method is required. I written this method in my code behind (C#) but I dont know how to call this method for verification. I tried OnCreatedUser but it wont work neither OnCreatingUser. Please suggest how can I call method for to check Page.IsValid or not using Create User Wizard.
Below is the method I want to call before creating user :
protected void Submit_Click(object sender, EventArgs e) { if (Page.IsValid) { Label1.Text = "Success"; //Go to next step } else { Label1.Text = "In-Correct"; //Stay at same page. } }Please suggest .
Thank you ,
Regards,
-Sunny.
Captcha create user wizard
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Create User Wizard with Captcha
Jan 01, 2008 04:41 AM|LINK
H
I've answered a similar thread about adding captcha control to CreateUserWizard. You may check the validity of captcha in CreateUserWizard.ActiveStepChanged Event
http://forums.asp.net/t/1186626.aspx
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
sunny_popali
Member
37 Points
48 Posts
Re: Create User Wizard with Captcha
Jan 01, 2008 12:53 PM|LINK
Thanks, I will check.
Happy New Year, to all ASP.NET forum members.
Regards,
-Sunny
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Create User Wizard with Captcha
Jan 02, 2008 02:30 AM|LINK
Thanks.
And wish you a happy New Year too.
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
sunny_popali
Member
37 Points
48 Posts
Re: Create User Wizard with Captcha
Jan 03, 2008 04:14 PM|LINK
Hi,
After few holidays, I finally got chance to look on this issue. But its not working in my case
I will show you complete code. I am trying to verify captcha in wizard steps, first captcha is verified then user should be able to create account.
Please point me where s the error.
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"> <WizardSteps> <asp:WizardStep ID="CreateUserWizardStep0" runat="server"> <recaptcha:RecaptchaControl ID="recaptcha" runat="server" Theme="" PublicKey="XXXX" PrivateKey="XXXX" IsValid="False" /> </asp:WizardStep> <asp:CreateUserWizardStep runat="server"> <ContentTemplate> <table border="0"> <tr> <td align="center" colspan="2"> Sign Up for Your New Account</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</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" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td> <td> <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td> <td> <asp:TextBox ID="Email" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td> <td> <asp:TextBox ID="Question" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question" ErrorMessage="Security question is required." ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td> <td> <asp:TextBox ID="Answer" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Security answer is required." ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="center" colspan="2"> <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> </td> </tr> <tr> <td align="center" colspan="2" style="color: red"> <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> </table> </ContentTemplate> </asp:CreateUserWizardStep> <asp:CompleteWizardStep runat="server"> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard>First step verifies captcha & take me to create user step, but unfortunately user is not getting created after entering all valid information, nor i am getting any validation error.
there is no code-behind file. Please suggest if code behind needed ? if yes wat things are necessary to mention in code behind.
Is this possible to add captcha control in same step where I am asking username, password,email etc, if yes how?
Please suggest.
Thank you,
Many Regards,
-Sunny.
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Create User Wizard with Captcha
Jan 04, 2008 01:45 AM|LINK
Hi
I suggest you check the validity of captcha in your customize CreateUserWizardStep, and redirect to the next step only if captcha Control returns true result, Since your captcha is third party control, so I cannot talk much about how to use this captcha. instead, I suppose you will get this result and use this in code behind like the following code
protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 0) {
if (!CustomValidation()){
//some code here
e.Cancel = true;}
}
}
private bool CustomValidation()
{
return true; //find captcha control and retrieve result
}
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
sunny_popali
Member
37 Points
48 Posts
Re: Create User Wizard with Captcha
Jan 04, 2008 12:27 PM|LINK
Hi,
There is no error in first step that is Captcha is getting validated by itself, & if I enter wrong value in captcha control wont go next step. If value is correct this allow me to go to next step & I can create user. But when I pass all valid values to fields like User Name, Password, Confirm Password, Email, Security Ques. & Ans. This step doesnt create any account nor gives error. Please suggest where is the error. Thanks,
Many Regards,
-Sunny.
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Create User Wizard with Captcha
Jan 07, 2008 01:46 AM|LINK
Hi
For test purpose, what will happen if you use a new CreateUserWizard (without Captcha control)?
I suggest you create user using code behind like this sample http://msdn2.microsoft.com/en-us/library/t8yy6w3h(VS.80).aspx
and then check ErrorMessage displaying on page, this may help you diagnose the cause of problem
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
sunny_popali
Member
37 Points
48 Posts
Re: Create User Wizard with Captcha
Jan 08, 2008 11:02 AM|LINK
Hi ,
Thank you once again for providing very useful resource.
If I do not add captcha user creation works & user gets created.
btw , there was bug in captcha control I fixed that now.
For Reference :
<div>I modified the actual source for the RecaptchaControl. The best way to do this is if you have VS.NET 2005/2008, create a solution with the RecaptchaControl (or download readymade from recaptcha website) project and your website. Then create a project reference to the RecaptchaControl in the website project. Now update the source in the RecaptchaControl project .i.e. set the recaptchaResponse variable in the RecaptchaControl class to the default value of RecaptchaResponse.Valid.</div> <div> </div> <div>Build the solution and the recaptcha control should start to behave when a ValidationSummary control is on the web page.</div><div> </div><div>Hopefully this will work.</div><div> </div><div>But I am not able to work this settings in single step , that is by adding control to CreateUserWizard control. I have to make User Steps, in my case 1st step ask captcha verification & next asks user details. If someone gets this done in single step , please post there views. Any help is greatly appriciated. </div><div> </div><div>Below are the references I used : </div><div> </div><div>http://recaptcha.net/plugins/aspnet/</div><div>http://aspnet.4guysfromrolla.com/articles/070506-1.aspx</div><div> </div><div>Thank you ,</div><div> </div><div>Many Regards,</div><div>-Sunny. </div><div> </div><div> </div><div> </div>
GertLab
Member
2 Points
2 Posts
Re: Create User Wizard with Captcha
Jan 12, 2008 09:51 AM|LINK
Hi Sunny,
Thanks for the heads up on the recaptcha bug. After i fixed the bug i got the CreateUserWizard to work with one step.
I Added this code to my "CreateUserWizard1_CreatingUser" event, To validate Recaptcha before adding the user.
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e) { Recaptcha.RecaptchaControl mycaptcha = (Recaptcha.RecaptchaControl)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("RecaptchaControl1"); mycaptcha.Validate(); Boolean answer = mycaptcha.IsValid; if (answer == false) { e.Cancel = true; } }And it works!!
Thanks Again
Gert