This is a migrated thread and some comments may be shown as answers.

Page causes validation errors when navigating to another page

1 Answer 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Johan
Top achievements
Rank 1
Johan asked on 31 Mar 2011, 12:55 PM
Hi,

I have a couple of pages with standard asp.net validation controls such as RequiredFieldValidator etc inside my RadAjaxPanel.

As soon as I navigate to another tab in my RadTabStrip the page seems to force validation errors and pretty much "locks" the page even though non of the fields was selected to enter data.

Only once all the required fields was entered the page seems to release the "lock" and only then am I able to navigate to another tab / page without even submitting the page.

Any idea what might be causing the "lock" and forced validation errors on the page?

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 31 Mar 2011, 01:16 PM
Hello Reyo,

Try to set the ValidationGroup for the validators and for the controls to validate. Here is a sample markup.
aspx:
<asp:TextBox ID="TextBox1" ValidationGroup="txtBox" runat="server">
</asp:TextBox>
<asp:RequiredFieldValidator  ID="RequiredFieldValidator1" ValidationGroup="txtBox" runat="server" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator">
</asp:RequiredFieldValidator>
<asp:Button ID="Button1" runat="server" Text="Button"  ValidationGroup="txtBox"/>
Here the validation happens only when clicking the Button1.

Thanks,
Shinu.
Tags
General Discussions
Asked by
Johan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or