mathieu_cupryk
asked on
CreateUser Wizard. when I remove the security question or answer, I get ...
I want to remove bothe from the code.
<legend>Security Question:</legend><span> <asp:TextBox runat="server" ID="Question" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Questio n" ValidationGroup="CreateUse rWizardCon trol" ErrorMessage="Security question is required." ToolTip="Security question is required." ID="QuestionRequired"></as p:Required FieldValid ator>
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Answer" ValidationGroup="CreateUse rWizardCon trol" ErrorMessage="Security answer is required." ToolTip="Security answer is required." ID="AnswerRequired">
</asp:RequiredFieldValidat or>
I get the folloing error:
<legend>Security Question:</legend><span> <asp:TextBox runat="server" ID="Question" CssClass="register_questio
<asp:RequiredFieldValidato
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio
<asp:RequiredFieldValidato
</asp:RequiredFieldValidat
I get the folloing error:
Using themed css files requires a header control on the page. (e.g. <head runat="server" />).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).
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:
[InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).]
System.Web.UI.PageTheme.SetStyleSheet() +1998478
System.Web.UI.Page.OnInit(EventArgs e) +2062526
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834
Can you post your source code?
ASKER
Sure,
<%@ Page Language="C#" MasterPageFile="~/MasterPa ge.master" CodeFile="Register.aspx.cs "
Inherits="Register_aspx" Title="Register" %>
<%@ Register src="~/Controls/Countries. ascx" tagname="Countries" tagprefix="CustomControl" %>
<%@ Register src="~/Controls/Gender.asc x" tagname="Gender" tagprefix="CustomControl" %>
<%@ Register src="~/Controls/Ethnicity. ascx" tagname="Ethnicity" tagprefix="CustomControl" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="Main " runat="server">
<div id="body">
<div id="col_main_left">
<div id="user_assistance">
<a id="content_start"></a>
All you have to do is fill in the information on the right.
<br><br>
After the information is received we will send you a confirmation e-mail on the
e-mail address you specify. You must click on the link in that e-mail to
activate your account. After you activate your account you'll be redirected to
a page where you can create your profile and upload photos.
</div>
</div>
<div id="col_main_right">
<h2 class="section">
Register</h2>
<div class="content_right">
<asp:Label ID="InfoLabel" runat="server" ForeColor="Red" Font-Italic="true" Visible="false" />
<fieldset>
<asp:CreateUserWizard ID="CreateUserWizardContro l" runat="server" OnCreatedUser="CreateUserW izardContr ol_Created User"
CreateUserButtonText="Subm it" TitleTextStyle-Height="50p x" FinishDestinationPageUrl=" ~/Default. aspx"
ContinueDestinationPageUrl ="~/Defaul t.aspx" ContinueButtonText="Contin ue to Homepage"
ContinueButtonType="Link" ActiveStepIndex="0" CssClass="register_text" OnCreateUserError="CreateU serWizardC ontrol_Cre ateUserErr or">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="Account Details:">
<ContentTemplate>
<legend>User Name:</legend><span>
<asp:TextBox runat="server" ID="UserName" CssClass="user_info"></asp :TextBox>< /span>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="UserNam e" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="User name is required." ToolTip="User name is required." ID="UserNameRequired"
Display="Dynamic">
</asp:RequiredFieldValidat or>
<asp:RegularExpressionVali dator runat="server" ControlToValidate="UserNam e" ValidationGroup="CreateUse rWizardCon trol"
ValidationExpression="^[0- 9a-zA-Z''- '\s]{1,40} $" ErrorMessage="User name is required and must be less than 40 characters long and contain only alphanumerics, apostrophes, spaces, or periods."
ToolTip="A valid user name is required." ID="UserNameRequiredFormat " Display="Dynamic">
</asp:RegularExpressionVal idator>
<legend>Password:</legend> <span>
<asp:TextBox runat="server" TextMode="Password" ID="Password" CssClass="register_passwor d"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Passwor d" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Password is required." ToolTip="Password is required." ID="PasswordRequired">
</asp:RequiredFieldValidat or>
<legend>Confirm Password:</legend><span>
<asp:TextBox runat="server" TextMode="Password" ID="ConfirmPassword" CssClass="register_passwor d"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Confirm Password" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Confirm password is required." ToolTip="Confirm password is required."
ID="ConfirmPasswordRequire d">
</asp:RequiredFieldValidat or>
<legend>Email:</legend><sp an>
<asp:TextBox runat="server" ID="Email" CssClass="user_info"></asp :TextBox>< /span>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Email" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Email is required." ToolTip="Email is required." ID="EmailRequired"
Display="Dynamic">
</asp:RequiredFieldValidat or>
<asp:RegularExpressionVali dator runat="server" ControlToValidate="Email" ValidationGroup="CreateUse rWizardCon trol"
ValidationExpression="^([0 -9a-zA-Z]( [-.\w]*[0- 9a-zA-Z])* @([0-9a-zA -Z][-\w]*[ 0-9a-zA-Z] \.)+[a-zA- Z]{2,9})$"
ErrorMessage="A valid email is required." ToolTip="A valid email is required."
ID="EmailRequiredFormat" Display="dynamic">
</asp:RegularExpressionVal idator>
<legend>Gender:</legend><s pan>
<CustomControl:Gender ID="MyGender" runat="server" /></span>
<legend>Ethnicity:</legend ><span>
<CustomControl:Ethnicity ID="MyEthnicity" runat="server" /></span>
<legend>Country:</legend>< span>
<CustomControl:Countries ID="MyCountries" runat="server" /></span>
<legend>Security Question:</legend><span>
<asp:TextBox runat="server" ID="Question" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Questio n" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Security question is required." ToolTip="Security question is required."
ID="QuestionRequired">
</asp:RequiredFieldValidat or>
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Answer" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ID="AnswerRequired">
</asp:RequiredFieldValidat or>
<asp:CompareValidator runat="server" ControlToValidate="Confirm Password" ValidationGroup="CreateUse rWizardCon trol"
ID="PasswordCompare" Display="Dynamic" ErrorMessage="The password and confirmation password must match."
ControlToCompare="Password ">
</asp:CompareValidator>
<asp:Literal runat="server" ID="FailureText" EnableViewState="True"></a sp:Literal >
</ContentTemplate>
</asp:CreateUserWizardStep >
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<FinishNavigationTemplate>
<asp:Button runat="server" CausesValidation="False" Text="Previous" CommandName="MovePrev"
ID="FinishPreviousButton" />
<asp:Button runat="server" Text="Finish" CommandName="MoveToFinish" ID="FinishButton" />
</FinishNavigationTemplate >
<TitleTextStyle Height="50px"></TitleTextS tyle>
</asp:CreateUserWizard>
</fieldset>
</div>
</div>
</div>
</asp:Content>
<%@ Page Language="C#" MasterPageFile="~/MasterPa
Inherits="Register_aspx" Title="Register" %>
<%@ Register src="~/Controls/Countries.
<%@ Register src="~/Controls/Gender.asc
<%@ Register src="~/Controls/Ethnicity.
<asp:Content ID="MainContent" ContentPlaceHolderID="Main
<div id="body">
<div id="col_main_left">
<div id="user_assistance">
<a id="content_start"></a>
All you have to do is fill in the information on the right.
<br><br>
After the information is received we will send you a confirmation e-mail on the
e-mail address you specify. You must click on the link in that e-mail to
activate your account. After you activate your account you'll be redirected to
a page where you can create your profile and upload photos.
</div>
</div>
<div id="col_main_right">
<h2 class="section">
Register</h2>
<div class="content_right">
<asp:Label ID="InfoLabel" runat="server" ForeColor="Red" Font-Italic="true" Visible="false" />
<fieldset>
<asp:CreateUserWizard ID="CreateUserWizardContro
CreateUserButtonText="Subm
ContinueDestinationPageUrl
ContinueButtonType="Link" ActiveStepIndex="0" CssClass="register_text" OnCreateUserError="CreateU
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1"
<ContentTemplate>
<legend>User Name:</legend><span>
<asp:TextBox runat="server" ID="UserName" CssClass="user_info"></asp
<asp:RequiredFieldValidato
ErrorMessage="User name is required." ToolTip="User name is required." ID="UserNameRequired"
Display="Dynamic">
</asp:RequiredFieldValidat
<asp:RegularExpressionVali
ValidationExpression="^[0-
ToolTip="A valid user name is required." ID="UserNameRequiredFormat
</asp:RegularExpressionVal
<legend>Password:</legend>
<asp:TextBox runat="server" TextMode="Password" ID="Password" CssClass="register_passwor
<asp:RequiredFieldValidato
ErrorMessage="Password is required." ToolTip="Password is required." ID="PasswordRequired">
</asp:RequiredFieldValidat
<legend>Confirm Password:</legend><span>
<asp:TextBox runat="server" TextMode="Password" ID="ConfirmPassword" CssClass="register_passwor
<asp:RequiredFieldValidato
ErrorMessage="Confirm password is required." ToolTip="Confirm password is required."
ID="ConfirmPasswordRequire
</asp:RequiredFieldValidat
<legend>Email:</legend><sp
<asp:TextBox runat="server" ID="Email" CssClass="user_info"></asp
<asp:RequiredFieldValidato
ErrorMessage="Email is required." ToolTip="Email is required." ID="EmailRequired"
Display="Dynamic">
</asp:RequiredFieldValidat
<asp:RegularExpressionVali
ValidationExpression="^([0
ErrorMessage="A valid email is required." ToolTip="A valid email is required."
ID="EmailRequiredFormat" Display="dynamic">
</asp:RegularExpressionVal
<legend>Gender:</legend><s
<CustomControl:Gender ID="MyGender" runat="server" /></span>
<legend>Ethnicity:</legend
<CustomControl:Ethnicity ID="MyEthnicity" runat="server" /></span>
<legend>Country:</legend><
<CustomControl:Countries ID="MyCountries" runat="server" /></span>
<legend>Security Question:</legend><span>
<asp:TextBox runat="server" ID="Question" CssClass="register_questio
<asp:RequiredFieldValidato
ErrorMessage="Security question is required." ToolTip="Security question is required."
ID="QuestionRequired">
</asp:RequiredFieldValidat
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio
<asp:RequiredFieldValidato
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ID="AnswerRequired">
</asp:RequiredFieldValidat
<asp:CompareValidator runat="server" ControlToValidate="Confirm
ID="PasswordCompare" Display="Dynamic" ErrorMessage="The password and confirmation password must match."
ControlToCompare="Password
</asp:CompareValidator>
<asp:Literal runat="server" ID="FailureText" EnableViewState="True"></a
</ContentTemplate>
</asp:CreateUserWizardStep
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<FinishNavigationTemplate>
<asp:Button runat="server" CausesValidation="False" Text="Previous" CommandName="MovePrev"
ID="FinishPreviousButton" />
<asp:Button runat="server" Text="Finish" CommandName="MoveToFinish"
</FinishNavigationTemplate
<TitleTextStyle Height="50px"></TitleTextS
</asp:CreateUserWizard>
</fieldset>
</div>
</div>
</div>
</asp:Content>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In the web.config.
<system.web>
<trace enabled="true" pageOutput="true" />
<customErrors defaultRedirect="Error.asp x" mode="RemoteOnly"/>
<pages styleSheetTheme="Red"/>
<authentication mode="Forms"/>
So it points to Appthemes folder Red?
I still have the problem when u tell me to change it.
<system.web>
<trace enabled="true" pageOutput="true" />
<customErrors defaultRedirect="Error.asp
<pages styleSheetTheme="Red"/>
<authentication mode="Forms"/>
So it points to Appthemes folder Red?
I still have the problem when u tell me to change it.
ASKER
it is specified in the web.config. the css.
I need to remove secret answer and secret question from creatwizard below without getting a css error.
<asp:CreateUserWizard ID="CreateUserWizardContro l" runat="server" OnCreatedUser="CreateUserW izardContr ol_Created User"
CreateUserButtonText="Subm it" TitleTextStyle-Height="50p x" FinishDestinationPageUrl=" ~/Default. aspx"
ContinueDestinationPageUrl ="~/Defaul t.aspx" ContinueButtonText="Contin ue to Homepage"
ContinueButtonType="Link" ActiveStepIndex="0" CssClass="register_text" OnCreateUserError="CreateU serWizardC ontrol_Cre ateUserErr or">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="Account Details:">
<ContentTemplate>
<legend>User Name:</legend><span>
<asp:TextBox runat="server" ID="UserName" CssClass="user_info"></asp :TextBox>< /span>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="UserNam e" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="User name is required." ToolTip="User name is required." ID="UserNameRequired"
Display="Dynamic">
</asp:RequiredFieldValidat or>
<asp:RegularExpressionVali dator runat="server" ControlToValidate="UserNam e" ValidationGroup="CreateUse rWizardCon trol"
ValidationExpression="^[0- 9a-zA-Z''- '\s]{1,40} $" ErrorMessage="User name is required and must be less than 40 characters long and contain only alphanumerics, apostrophes, spaces, or periods."
ToolTip="A valid user name is required." ID="UserNameRequiredFormat " Display="Dynamic">
</asp:RegularExpressionVal idator><le gend>Passw ord:</lege nd><span>
<asp:TextBox runat="server" TextMode="Password" ID="Password" CssClass="register_passwor d"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Passwor d" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Password is required." ToolTip="Password is required." ID="PasswordRequired">
</asp:RequiredFieldValidat or>
<legend>Confirm Password:</legend><span>
<asp:TextBox runat="server" TextMode="Password" ID="ConfirmPassword" CssClass="register_passwor d"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Confirm Password" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Confirm password is required." ToolTip="Confirm password is required."
ID="ConfirmPasswordRequire d">
</asp:RequiredFieldValidat or>
<legend>Email:</legend><sp an>
<asp:TextBox runat="server" ID="Email" CssClass="user_info"></asp :TextBox>< /span>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Email" ValidationGroup="CreateUse rWizardCon trol" ErrorMessage="Email is required." ToolTip="Email is required." ID="EmailRequired" Display="Dynamic"></asp:Re quiredFiel dValidator >
<asp:RegularExpressionVali dator runat="server" ControlToValidate="Email" ValidationGroup="CreateUse rWizardCon trol" ValidationExpression="^([0 -9a-zA-Z]( [-.\w]*[0- 9a-zA-Z])* @([0-9a-zA -Z][-\w]*[ 0-9a-zA-Z] \.)+[a-zA- Z]{2,9})$" ErrorMessage="A valid email is required." ToolTip="A valid email is required." ID="EmailRequiredFormat" Display="dynamic">
</asp:RegularExpressionVal idator>
<legend>Gender:</legend><s pan>
<CustomControl:Gender ID="MyGender" runat="server" /></span>
<legend>Ethnicity:</legend ><span>
<CustomControl:Ethnicity ID="MyEthnicity" runat="server" /></span>
<legend>Date of Birth:</legend><span>
<CustomControl:BirthDate ID="MyBirthDate" runat="server" /></span>
<legend>Country:</legend>< span>
<CustomControl:Countries ID="MyCountries" runat="server" /></span>
<legend>Security Question:</legend><span>
<asp:TextBox runat="server" ID="Question" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Questio n" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Security question is required." ToolTip="Security question is required."
ID="QuestionRequired">
</asp:RequiredFieldValidat or>
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio n"></asp:T extBox></s pan>
<asp:RequiredFieldValidato r runat="server" ControlToValidate="Answer" ValidationGroup="CreateUse rWizardCon trol"
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ID="AnswerRequired">
</asp:RequiredFieldValidat or>
<asp:CompareValidator runat="server" ControlToValidate="Confirm Password" ValidationGroup="CreateUse rWizardCon trol"
ID="PasswordCompare" Display="Dynamic" ErrorMessage="The password and confirmation password must match."
ControlToCompare="Password ">
</asp:CompareValidator>
<asp:Literal runat="server" ID="FailureText" EnableViewState="True"></a sp:Literal >
</ContentTemplate>
</asp:CreateUserWizardStep >
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<FinishNavigationTemplate>
<asp:Button runat="server" CausesValidation="False" Text="Previous" CommandName="MovePrev"
ID="FinishPreviousButton" />
<asp:Button runat="server" Text="Finish" CommandName="MoveToFinish" ID="FinishButton" />
</FinishNavigationTemplate >
I need to remove secret answer and secret question from creatwizard below without getting a css error.
<asp:CreateUserWizard ID="CreateUserWizardContro
CreateUserButtonText="Subm
ContinueDestinationPageUrl
ContinueButtonType="Link" ActiveStepIndex="0" CssClass="register_text" OnCreateUserError="CreateU
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1"
<ContentTemplate>
<legend>User Name:</legend><span>
<asp:TextBox runat="server" ID="UserName" CssClass="user_info"></asp
<asp:RequiredFieldValidato
ErrorMessage="User name is required." ToolTip="User name is required." ID="UserNameRequired"
Display="Dynamic">
</asp:RequiredFieldValidat
<asp:RegularExpressionVali
ValidationExpression="^[0-
ToolTip="A valid user name is required." ID="UserNameRequiredFormat
</asp:RegularExpressionVal
<asp:TextBox runat="server" TextMode="Password" ID="Password" CssClass="register_passwor
<asp:RequiredFieldValidato
ErrorMessage="Password is required." ToolTip="Password is required." ID="PasswordRequired">
</asp:RequiredFieldValidat
<legend>Confirm Password:</legend><span>
<asp:TextBox runat="server" TextMode="Password" ID="ConfirmPassword" CssClass="register_passwor
<asp:RequiredFieldValidato
ErrorMessage="Confirm password is required." ToolTip="Confirm password is required."
ID="ConfirmPasswordRequire
</asp:RequiredFieldValidat
<legend>Email:</legend><sp
<asp:TextBox runat="server" ID="Email" CssClass="user_info"></asp
<asp:RequiredFieldValidato
<asp:RegularExpressionVali
</asp:RegularExpressionVal
<legend>Gender:</legend><s
<CustomControl:Gender ID="MyGender" runat="server" /></span>
<legend>Ethnicity:</legend
<CustomControl:Ethnicity ID="MyEthnicity" runat="server" /></span>
<legend>Date of Birth:</legend><span>
<CustomControl:BirthDate ID="MyBirthDate" runat="server" /></span>
<legend>Country:</legend><
<CustomControl:Countries ID="MyCountries" runat="server" /></span>
<legend>Security Question:</legend><span>
<asp:TextBox runat="server" ID="Question" CssClass="register_questio
<asp:RequiredFieldValidato
ErrorMessage="Security question is required." ToolTip="Security question is required."
ID="QuestionRequired">
</asp:RequiredFieldValidat
<legend>Security Answer:</legend><span>
<asp:TextBox runat="server" ID="Answer" CssClass="register_questio
<asp:RequiredFieldValidato
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ID="AnswerRequired">
</asp:RequiredFieldValidat
<asp:CompareValidator runat="server" ControlToValidate="Confirm
ID="PasswordCompare" Display="Dynamic" ErrorMessage="The password and confirmation password must match."
ControlToCompare="Password
</asp:CompareValidator>
<asp:Literal runat="server" ID="FailureText" EnableViewState="True"></a
</ContentTemplate>
</asp:CreateUserWizardStep
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<FinishNavigationTemplate>
<asp:Button runat="server" CausesValidation="False" Text="Previous" CommandName="MovePrev"
ID="FinishPreviousButton" />
<asp:Button runat="server" Text="Finish" CommandName="MoveToFinish"
</FinishNavigationTemplate
If you don't remove it, it doesn't throw an error?
Check out this link: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=102039
Check out this link: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=102039
ASKER
It is in the master page? <head id="HeadElement" runat="server">
There is suppose to be a way in the web.config file to disable this.
There is suppose to be a way in the web.config file to disable this.
ASKER
U know something Dig,
U are amazing...
I did it.
Is this a bug?
U are amazing...
I did it.
Is this a bug?
ASKER
Excellent job
Hey glad it worked! And thanks. ;)