I am having a trouble when i am using CreateUserWizardStep to register for a new user.
Could anyone help me to solve out this problem.I have tried to change in the web.config for memebership Provider Tag.
<requiresQuestionAndAnswer="false">
However it is not still working !...i am using the MYSQL database.
RegisterUser: CreateUserWizardStep.ContentTemplate does not contain an IEditableTextControl with ID Question for the security question, this is required if your membership provider requires a question and answer.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): RegisterUser: CreateUserWizardStep.ContentTemplate does not contain an IEditableTextControl with ID Question for the security question, this is required if your membership provider requires a question and answer.]
System.Web.UI.WebControls.CreateUserStepContainer.get_QuestionTextBox() +1448475 System.Web.UI.WebControls.CreateUserWizard.CreateControlHierarchy() +172 System.Web.UI.WebControls.Wizard.CreateChildControls() +137 System.Web.UI.WebControls.CreateUserWizard.CreateChildControls() +26 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.WebControls.Wizard.OnInit(EventArgs e) +90
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
The following is my MembershipProvider in the web.config.
I had the same issue with MySQL. Add this to you Register.aspx file. That worked for me!
Code:
<p>
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Pregunta de Seguridad:</asp:Label>
<asp:TextBox ID="Question" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
CssClass="failureNotification" ErrorMessage="La pregunta de seguridad es requerida." ToolTip="La pregunta de seguridad es requerida."
ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Respuesta de Seguridad:</asp:Label>
<asp:TextBox ID="Answer" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
CssClass="failureNotification" ErrorMessage="La respuesta de seguridad es requerida." ToolTip="La respuesta de seguridad es requerida."
ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
Two things to check again:
1: Check you have done right adjustments to membership provider in your web.config. If you are not sure please share your membership provider setting from your web.config.
2: If you have more than one in your web.config, make sure your CUW is in fact using the right membership provider. CUW has a MembershipProvider property to use in that case.
If you override your merbershipprovide please remember return the RequiresQuestionAndAnswer value from your config by below steps:
public class SQLMembershipProvider : MembershipProvider
{
private bool _requiresQuestionAndAnswer;
public override bool RequiresQuestionAndAnswer
{
get
{
return _requiresQuestionAndAnswer;
}
}
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
if (config["requiresQuestionAndAnswer"].ToLower() == "true")
{
_requiresQuestionAndAnswer = true;
}
else
{
_requiresQuestionAndAnswer = false;
}
}
}
Well, I guess the error is pretty clear: have you added a IEditableTextControl with ID Question for the security question?
User contributions licensed under CC BY-SA 3.0