here is my code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
TagPrefix="cc2" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc2" %>
New User |
Font-Names="Verdana"
BackColor="#E3EAEB"
Font-Size="0.8em"
BorderWidth="1px"
BorderColor="#E6E2D8"
BorderStyle="Solid"
CompleteSuccessText="The account has been successfully created."
UnknownErrorMessage="The account was not created. Please try again."
OnCreatedUser="CreateUserWizard1_CreatedUser" Width="450px" OnFinishButtonClick="CreateUserWizard1_FinishButtonClick">
Create Your UserID | |
ToolTip="User Name is required." ErrorMessage="User Name is required." Text="*" ValidationGroup="CreateUserWizard1" ControlToValidate="UserName"/> | |
runat="server" TextStrengthDescriptions="Very Poor;Weak;Average;Strong;Excellent" PreferredPasswordLength="6" StrengthIndicatorType="Text" TargetControlID="Password"/> ToolTip="Password is required." Text="*" ErrorMessage="Password is required." ValidationGroup="CreateUserWizard1" ControlToValidate="Password"/> | |
Text="Re-Type Password:" runat="server" AssociatedControlID="ConfirmPassword"/> | ErrorMessage="Password not matched" Text="*" ControlToCompare="ConfirmPassword" ControlToValidate="Password" ValidationGroup="CreateUserWizard1"/> |
runat="server" ControlToValidate="email" ErrorMessage="Email Addr Invalid" Font-Size="Smaller" Text="Invalid format" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"/> runat="server" ToolTip="Email is required." Text="*" ErrorMessage="Email is required" ValidationGroup="CreateUserWizard1" ControlToValidate="Email"/> | |
Identify the Word:
BackColor="White" CaptchaChars="ACDEFGHJKLNPQRTUVXYZ2346789"
CaptchaMinTimeout="3" FontColor="Black" LineColor="Black"
NoiseColor="Black" />
BorderWidth="1px" Font-Names="Verdana" ForeColor="#1C5E55" />
BorderWidth="1px" Font-Names="Verdana" ForeColor="#1C5E55" />
Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Center" />
BorderWidth="1px" Font-Names="Verdana" ForeColor="#1C5E55" />
BorderStyle="Solid" BorderWidth="1px" CausesValidation="False" CommandName="MovePrevious"
Font-Names="Verdana" ForeColor="#284E98" Text="Previous" />
BorderStyle="Solid" BorderWidth="1px" CommandName="MoveNext" Font-Names="Verdana"
ForeColor="#284E98" Text="Next" />
.CS
public void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
p.Country = ((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Country")).SelectedValue;
p.Gender = ((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Gender")).SelectedValue;
p.FirstName = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtfname")).Text;
p.Email = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Email")).Text;
p.LastName = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtlname")).Text;
//p.Address = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtaddr")).Text;
p.BirthDate = Convert.ToDateTime(((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtbdate")).Text);
// p.City = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("city")).Text;
// p.PostCode = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtpcode")).Text;
// p.State = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtstat")).Text;
if (((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtPictureURL")).Text == null)
{
p.uimage = "";
}
else
{
p.uimage = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtPictureURL")).Text;
}
//// Save the profile - must be done since we explicitly created this profile instance
p.Save();
}
protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
TextBox t = (TextBox)CreateUserWizard1.WizardSteps[1].FindControl("TextBox1");
CaptchaControl1.ValidateCaptcha(t.Text);
if (!CaptchaControl1.UserValidated)
{
System.Windows.Forms.MessageBox.Show("You Have Entered wrong word");
return;
t.Focus();
}
}
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Amit ChoudharyPosted Feb 15, 2010, 2:01 AM
i have modified your code and now it is working as per your requirement.
Download the project.
Dipa AhujaPosted Feb 15, 2010, 12:47 PM
so i mark your answer,,,
Thank you!
Dipa AhujaPosted Feb 15, 2010, 11:09 AM
my requirement was to put the captcha second wizard step .. bt anyways thanx ..!
Amit ChoudharyPosted Feb 11, 2010, 8:18 AM
i have downloaded you project and i'll ananlyse it and send you help if i can.
Thanks
Amit
Amit ChoudharyPosted Feb 11, 2010, 8:00 AM
Captcha control
is it your control or you are using third party control???
if it is yours then send me the code of CS file you are using... i'll give it a view.
Thanks
Amit