2011-03-28 111 views
1

我在使用CreateUserWizardStep注册新用户时遇到了麻烦。注册用户:CreateUserWizardStep

任何人都可以帮助我解决这个问题。我试图在web.config中更改memebership Provider Tag。

<requiresQuestionAndAnswer="false"> 

但是,它仍然没有工作!...我使用MYSQL数据库。

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

以下是我在web.config中的MembershipProvider。

回答

0

嗯,我猜的错误是很清楚的:你加入了的IEditableTextControl ID为质疑的安全问题?

+0

谢谢。我可以解决这个问题...我使用的web.config与那个不兼容..这就是为什么..在我改变machine.config ..我可以做.. :-) – thidar 2011-03-29 01:40:33

1

两件事情,再次检查:

1:检查你已经在你的web.config做成员提供合适的调整。如果您不确定,请从web.config中分享您的成员资格提供者设置。

2:如果您的web.config中有多个,请确保您的CUW实际上使用了正确的成员资格提供程序。在这种情况下,CUW具有MembershipProvider属性。

3

// Hola!

我与mySQL有同样的问题。将此添加到您的Register.aspx文件。这对我有用! // Tengo el mismo problema con mySQL。 Agrega esto a tu archivo Register.aspx。 Funcionópara mi!

代码:

    <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> 

希望这有助于! // Espero que sirva de ayuda!

问候// Saludos Locuranet2 - 布宜诺斯艾利斯 - 阿根廷

1

如果重写你的merbershipprovide请记得下面的步骤恢复你的配置的RequiresQuestionAndAnswer值:

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; 
    } 
} 

}