PDA

View Full Version : کنترل asp:CreateUserWizard من کار نمیکنه.میشه راهنمایی کنید؟



hgh.just.hony
یک شنبه 13 اسفند 1391, 12:19 عصر
سلام
من از لوگین خود asp دارم استفاده میکنم
چون جداولم سنگین بود دیتاهام و از سرور به لوکال منتقل کردم و کل جداولم(حتی جداول مربوط به لوگین asp) را خالی و تمام رکوردهاش و حذف کردم
اما دیدم در asp:CreateUserWizard دکمه NextButtonClick دیگه کار نمیکنه
کمی گوگلینگ کردم اما به جواب نرسیدم
حدس زدم که شاید دیتاهای تو جداول نیاز بوده و من همین جوری پاک کردم خطا داره میده
از کل اطلاعات جز دیتای مربرو به افرادی که ثبت نام کردند باقی رو برگردوندم
اما هنوز خطا داره



<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
OnCreatedUser="CreateUserWizard1_CreatedUser" CreateUserButtonText="ثبت نام"
Font-Names="Tahoma" Font-Size="Small"
CompleteSuccessText="حساب کاربری شما با موفقیت ایجاد شد"
ContinueButtonText="ادامه" FinishDestinationPageUrl="~/Default.aspx"
RequireEmail="False" OnFinishButtonClick="CreateUserWizard1_FinishButtonClick"
OnNextButtonClick="CreateUserWizard1_NextButtonClick" Width="452px"
StartNextButtonText="مرحله بعد" StepNextButtonText="مرحله بعد"
ActiveStepIndex="1">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" AllowReturn="False" StepType="Start" Title="ایجاد حساب کاربری">
<table style="width: 400px">
<tr style="background-color:#eef1ef">
<td colspan="2" style="text-align: center" >
<strong><span style="font: 10pt tahoma;">ثبت نام</span></strong></td>

</tr>
<tr >
<td style="text-align: right; width: 198px;" > <span style="font-size: 10pt"><strong>
&nbsp;</strong>تصویر امنیتی</span></td>
<td style="text-align: left">
<img id="IMG1" alt="" height="30" src="Tunning.aspx" width="80" onclick="return IMG1_onclick()" /></td>
</tr>

<tr >
<td style="text-align: right; width: 198px;" > <span style="font-size: 10pt"><strong>
&nbsp;</strong>لطقاً حروف تصویر را وارد کنید</span></td>
<td style="text-align: left">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>

</table>
<asp:Label ID="Label3" runat="server" Font-Size="Small" ForeColor="#C00000"></asp:Label>
</asp:WizardStep>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="ایجاد حساب کاربری جدید">
<ContentTemplate>

<table border="0" class="TABLE" width="450" >
<tr>
<td align="center" colspan="3"><font face="Tahoma" size="2" >
ثبت نام<br />
<span style="color: #cc0000">* لطفا" قبل از ورود به سیستم ضوابط و مقررات خرید اینترنتی
بلیت<br />
از سایت را مطالعه فرمائید . ثبت نام به منزله پذیرش کلیه مفاد قید شده می باشد. </span>
</font></td>

</tr>
<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label CssClass="TD" ID="UserNameLabel" runat="server" AssociatedControlID="UserName" Font-Names="Tahoma" Font-Size="10pt">نام کاربری :</asp:Label></td>
<td style="height: 26px; width: 187px;">
<asp:TextBox ID="UserName" runat="server" Width="145px"></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>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">(لاتین)شامل حرف و عدد</span></td>
</tr>
<tr>
<td align="right" style="height: 24px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Font-Names="Tahoma" Font-Size="10pt">کلمه عبور :</asp:Label></td>
<td style="width: 187px; height: 24px;">
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="145px"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">حداقل 5 حرف</span></td>
</tr>
<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword" Font-Names="Tahoma" Font-Size="10pt">تکرار کلمه عبور :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" Width="145px"></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>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">حداقل 5 حرف</span></td>
</tr>
<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" Font-Names="Tahoma" Font-Size="10pt">پست الکترونیکی :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Email" runat="server" Width="145px"></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>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">به صورت test@test.com</span></td>
</tr>




<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="NameLabel" runat="server" AssociatedControlID="Name" Font-Names="Tahoma" Font-Size="10pt">نام :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Name" runat="server" Width="145px"></asp:TextBox>
<asp:RequiredFieldValidator ID="NameRequired" runat="server" ControlToValidate="Name"
ErrorMessage="Name is required." ToolTip="Name is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">فارسی</span></td>
</tr>
<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="FamilyLabel" runat="server" AssociatedControlID="Family" Font-Names="Tahoma" Font-Size="10pt">نام حانوادگی :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Family" runat="server" Width="145px"></asp:TextBox>
<asp:RequiredFieldValidator ID="FamilyRequired" runat="server" ControlToValidate="Family"
ErrorMessage="Family is required." ToolTip="Family is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">فارسی</span></td>
</tr>

<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="phoneLabel" runat="server" AssociatedControlID="phone" Font-Names="Tahoma" Font-Size="10pt">تلفن تماس (تابت) :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="phone" runat="server" Width="145px" onkeyup="res(this,phone);"></asp:TextBox>
<asp:RequiredFieldValidator ID="phoneRequired" runat="server" ControlToValidate="phone"
ErrorMessage="phone is required." ToolTip="phone is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>&nbsp;
</td>
<td width="200" style="background-color:#eef1ef; text-align: right;" dir="ltr">
<span style="font-size: 9pt">مثال : &nbsp;02188776655</span></td>
</tr>


<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="Label2" runat="server" AssociatedControlID="phone" Font-Names="Tahoma" Font-Size="10pt">تلفن تماس (همراه) :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Cell" runat="server" Width="145px" onkeyup="res(this,phone);"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Cell"
ErrorMessage="*" ToolTip="phone is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">مثال : 09171231234</span></td>
</tr>

<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="Label1" runat="server" AssociatedControlID="phone" Font-Names="Tahoma" Font-Size="10pt">کد ملی :</asp:Label></td>
<td align="right" style="width: 187px">
<span dir="ltr">
<asp:TextBox ID="BirthDate" runat="server" Width="145px" onkeyup="res(this,phone);"></asp:TextBox></span>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="BirthDate"
ErrorMessage="BirthDate is required." ToolTip="کد ملی الزامیست"
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">مثال: 24710591622</span></td>
</tr>

<tr>
<td align="right" style="height: 66px;background-color: #eef1ef; width: 172px;">
<asp:Label ID="addressLabel" runat="server" AssociatedControlID="address" Font-Names="Tahoma" Font-Size="10pt">آدرس :</asp:Label></td>
<td style="height: 66px; width: 187px;">
<asp:TextBox ID="address" runat="server" Height="124px" TextMode="MultiLine" Width="145px"></asp:TextBox>
<asp:RequiredFieldValidator ID="addressRequired" runat="server" ControlToValidate="address"
ErrorMessage="address is required." ToolTip="address is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">فارسی</span></td>
</tr>

<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" Font-Names="Tahoma" Font-Size="10pt">سوال امنیتی :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Question" runat="server" Width="145px"></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>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">جهت بازیابی کلمه عبور</span></td>
</tr>
<tr>
<td align="right" style="height: 26px; background-color: #eef1ef; width: 172px;">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" Font-Names="Tahoma" Font-Size="10pt">پاسخ امنیتی :</asp:Label></td>
<td style="width: 187px">
<asp:TextBox ID="Answer" runat="server" Width="145px"></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>
<td width="200" style="background-color:#eef1ef;">
<span style="font-size: 9pt">جهت بازیابی کلمه عبور</span></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>
<td width="200"> </td>
</tr>
<tr>
<td align="center" colspan="2" style="color: red; height: 21px;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
<td width="200" style="height: 21px"> </td>
</tr>
</table>
</ContentTemplate>
<CustomNavigationTemplate>
<table border="0" cellspacing="5" style="width: 100%; height: 100%;">
<tr align="right">
<td align="right" colspan="0">
<asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext"
Font-Names="tahoma" Font-Size="10pt" Text="ثبت نام"
ValidationGroup="CreateUserWizard1" />
</td>
</tr>
</table>
</CustomNavigationTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server" Title="پایان" AllowReturn="False">
<ContentTemplate>
<table border="0" style="font-size: 100%; font-family: Tahoma">
<tr>
<td align="center" colspan="2">
پایان</td>
</tr>
<tr>
<td>
حساب کاربری شما با موفقیت ایجاد شد</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
Text="ادامه" ValidationGroup="CreateUserWizard1" OnClick="ContinueButton_Click" Font-Names="tahoma" Font-Size="10pt" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
<FinishCompleteButtonStyle Font-Names="Tahoma" Font-Overline="True" />
<SideBarStyle Font-Names="Tahoma" />
<StepNextButtonStyle Font-Names="Tahoma" Font-Size="Small" />
<SideBarButtonStyle Font-Names="Tahoma" />
<NavigationButtonStyle Font-Names="Tahoma" />
<NavigationStyle Font-Names="tahoma" />
<StartNextButtonStyle Font-Names="Tahoma" Font-Size="Small" />
<StepStyle Font-Names="Tahoma" Font-Size="Small" />
<StepPreviousButtonStyle Font-Names="Tahoma" />
</asp:CreateUserWizard>

</ContentTemplate>
</asp:UpdatePanel>


<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
<ProgressTemplate>
<div style="background-color:rbga(187,187,187,0.5);color:Gray;text-align:center;top:0px;left:0px;position:inherit;
right:0px;bottom:0px; height: 52px;position:inherit"> صبر کنید
<img src="images/ajax-loader.gif" alt="Loading....." />
</div>
</ProgressTemplate>
</asp:UpdateProgress>



protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
//// Create an empty Profile for the newly created user

//ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWiza rd1.UserName, true);
//// Populate some Profile properties off of the create user wizard
//p.Name = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("Name")).Text;

//p.Family = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("Family")).Text;
//p.phone = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("phone")).Text;
//p.address = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("address")).Text;
//p.BirthDay = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("BirthDate")).Text;
//p.Cell = ((TextBox)CreateUserWizard1.CreateUserStep.Content TemplateContainer.FindControl("Cell")).Text;

//// Save profile - must be done since we explicitly created it
//p.Save();
FormsAuthentication.SetAuthCookie(CreateUserWizard 1.UserName, true);
Response.Redirect("default.aspx");
}
protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
Response.Redirect("Default.aspx");
}
protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 0)
{

if (Page.IsValid && (TextBox1.Text == Session["randomStr"].ToString()))
{
//Inform user that his input was wrong ...
}
else
{
Label3.Text = "حروف وارد شده صحیح نمی باشد.";///
e.Cancel = true;
}
}
}
protected void ContinueButton_Click(object sender, EventArgs e)
{
Response.Redirect("Default.aspx");
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{

}
protected void Question_TextChanged(object sender, EventArgs e)
{

}



:گریه::گریه::گریه::گریه::گریه: :گریه::عصبانی++::عصبانی++:
کانکشنم درسته چون تو بقیه جداول هم درج و هم حذف و ... میتونم بکنم