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

Using Validators in a TabStrip

4 Answers 175 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Darlene
Top achievements
Rank 1
Darlene asked on 12 May 2008, 04:16 PM
Hi!

I have a TabStrip on my page and within one of the PageViews, there are controls that use validators such as RequiredFieldValidator.  When the validator is present, the tabs on the TabStrip do not work.  If I remove the validator, the TabStrip works as it should.  How can I make the TabStrip work with the validator?

I have attached a small code sample that reduplicates the problem.

Thank you!

<form id="form1" runat="server">  
    <div> 
    <telerik:RadScriptManager ID="RSM" runat="server"></telerik:RadScriptManager> 
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Hay" MultiPageID="RadMultiPage1">  
            <Tabs> 
                <telerik:RadTab Text="Tab 1" PageViewID="pv1" Selected="true"></telerik:RadTab> 
                <telerik:RadTab Text="Tab 2" PageViewID="pv2"></telerik:RadTab> 
                <telerik:RadTab Text="Tab 3" PageViewID="pv3"></telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">  
            <telerik:RadPageView ID="pv1" runat="server">  
                <asp:Label ID="Label1" runat="server" Text="This is tab 1"></asp:Label> 
            </telerik:RadPageView> 
            <telerik:RadPageView ID="pv2" runat="server">  
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="TextBox1"></asp:RequiredFieldValidator> 
            </telerik:RadPageView> 
            <telerik:RadPageView ID="pv3" runat="server">  
                <asp:Label ID="Label3" runat="server" Text="This is tab 3"></asp:Label> 
            </telerik:RadPageView> 
        </telerik:RadMultiPage> 
    </div> 
    </form> 

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 May 2008, 01:01 PM
Hi Darlene,

Go through the following online demo.
Validation Groups

Princy.
0
Accepted
Paul
Telerik team
answered on 13 May 2008, 01:03 PM
Hi Darlene,

In order to achieve your goal you will have to set CausesValidation="False" in the definition of the tabstrip control.

Another possible solution for this issue is to set the tabstrip AutoPostBack property to true and the multipage RenderSelectedPageOnly to true. This will prevent the invisible validators from firing.

Regards,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Darlene
Top achievements
Rank 1
answered on 13 May 2008, 01:18 PM
Thank you both!  It's working now :)
0
Rory
Top achievements
Rank 1
answered on 15 Mar 2010, 07:40 PM
Hi Darlene,
What if we want our "invisible validators" to fire?

We are using tabstrip as a multi tab form and we are leveraging RenderSelectedPageOnly="True" to increase performance on page load and save times. The issue is if any field has a requiredfieldvalidator on another tab and you click save without visiting that tab the validation doesn't fire. We thought that at least the server side validation would fire since we can see the controls server side on save. Any help would be appreciated.
Thanks.
Tags
TabStrip
Asked by
Darlene
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Paul
Telerik team
Darlene
Top achievements
Rank 1
Rory
Top achievements
Rank 1
Share this question
or