I have a wizard control and in one of the steps, I checked the input box if it's blank or not. By doing this, now the sidebar link and other steps all cause validation = true. How can I resolve this problem so that the cause validations for sidebars and
other steps are false?
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; Windows-Media-Player/10.00.00.3990; .NET CLR 3.0.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; AskTB5.4)
Timestamp: Tue, 19 Jan 2010 01:26:03 UTC
Message: Object expected
Line: 12
Char: 6
Code: 0
Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'ction||Profile.aspx|<script language='ja'.
Line: 4723
Char: 21
Code: 0
By default all textBox controls are with CausesValidation=false. If you change this and don't assign a validation group for that particular textbox then on postback all controls that can be validated on the page will be validated. To avoid this assign the
textbox control to a ValidationGroup like so:
<form id="form1" runat="server">
<h3>BaseValidator ValidationGroup Example</h3>
Please enter your name:<br/>
<asp:textbox id="NameTextBox"
runat="server"/>
<asp:requiredfieldvalidator id="NameTextBoxRequiredValidator"
controltovalidate="NameTextBox"
display="Dynamic"
text="Please enter your name."
validationgroup="UserInfoGroup"
runat="server"/>
<br /><br />
<asp:button id="SubmitButton"
text="Submit"
validationgroup="UserInfoGroup"
runat="server"/>
<hr/>
Please enter a search topic:<br/>
<asp:textbox id="SearchTextBox"
runat="server"/>
<asp:requiredfieldvalidator id="SearchTextBoxRequiredValidator"
controltovalidate="SearchTextBox"
display="Dynamic"
text="Please enter a topic."
validationgroup="SearchGroup"
runat="server"/>
<br /><br />
<asp:button id="SearchButton"
text="Search"
validationgroup="SearchGroup"
runat="server"/>
</form>
You should run the above example to see what I am talking about. So just assign the validationgroup property of the one textbox control and it should solve your problem
validation validationgroup
Answering a question increases your knowledge asking a question shows your Intelligence!
The error seems to come from the updatepanel. If I remove the updatepanel, I don't see any errors. I am not using any response.write / response.redirect. It's simply an updatepanel that has content template and a wizard control
The error seems to come from the updatepanel. If I remove the updatepanel, I don't see any errors. I am not using any response.write / response.redirect. It's simply an updatepanel that has content template and a wizard control
Could you please post the relevant code for us checking?
Gary yang - MSFT
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
aspbie
Member
12 Points
133 Posts
causevalidation in wizard control
Jan 18, 2010 09:51 PM|LINK
I have a wizard control and in one of the steps, I checked the input box if it's blank or not. By doing this, now the sidebar link and other steps all cause validation = true. How can I resolve this problem so that the cause validations for sidebars and other steps are false?
b471code3
Star
13877 Points
2598 Posts
Re: causevalidation in wizard control
Jan 18, 2010 11:33 PM|LINK
Set the CausesValidation property of those items to False. You may have to create a template field for the navigation to do so.
aspbie
Member
12 Points
133 Posts
Re: causevalidation in wizard control
Jan 19, 2010 12:27 AM|LINK
The errors are:
FancyKetsup
Participant
1901 Points
391 Posts
Re: causevalidation in wizard control
Jan 19, 2010 12:29 AM|LINK
By default all textBox controls are with CausesValidation=false. If you change this and don't assign a validation group for that particular textbox then on postback all controls that can be validated on the page will be validated. To avoid this assign the textbox control to a ValidationGroup like so:
<form id="form1" runat="server"> <h3>BaseValidator ValidationGroup Example</h3> Please enter your name:<br/> <asp:textbox id="NameTextBox" runat="server"/> <asp:requiredfieldvalidator id="NameTextBoxRequiredValidator" controltovalidate="NameTextBox" display="Dynamic" text="Please enter your name." validationgroup="UserInfoGroup" runat="server"/> <br /><br /> <asp:button id="SubmitButton" text="Submit" validationgroup="UserInfoGroup" runat="server"/> <hr/> Please enter a search topic:<br/> <asp:textbox id="SearchTextBox" runat="server"/> <asp:requiredfieldvalidator id="SearchTextBoxRequiredValidator" controltovalidate="SearchTextBox" display="Dynamic" text="Please enter a topic." validationgroup="SearchGroup" runat="server"/> <br /><br /> <asp:button id="SearchButton" text="Search" validationgroup="SearchGroup" runat="server"/> </form>You should run the above example to see what I am talking about. So just assign the validationgroup property of the one textbox control and it should solve your problem
validation validationgroup
b471code3
Star
13877 Points
2598 Posts
Re: causevalidation in wizard control
Jan 19, 2010 12:30 AM|LINK
Error doesn't give much info. Post your code pertinent to the problem.
aspbie
Member
12 Points
133 Posts
Re: causevalidation in wizard control
Jan 19, 2010 12:38 AM|LINK
The error seems to come from the updatepanel. If I remove the updatepanel, I don't see any errors. I am not using any response.write / response.redirect. It's simply an updatepanel that has content template and a wizard control
Gary yang - ...
All-Star
25901 Points
2588 Posts
Re: causevalidation in wizard control
Jan 22, 2010 08:40 AM|LINK
Could you please post the relevant code for us checking?
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.