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

Page.IsValid incorrect when RenderSelectedPageOnly=true in RadMultiPage

8 Answers 145 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 30 Jun 2011, 04:02 PM
Hi,

I have a RadTabStrip tied to a RadMultiPage.  The RadTabStrip has CausesValidation="false" and the ontabclick event is handled.  In the event handler, I call Page.Validate() and then inspect Page.IsValid.  When the RadMultiPage control has RenderSelectedPageOnly="false", this works as expected.  When it has RenderSelectedPageOnly="true", my validator is effectively ignored and Page.IsValid is returned as true.

Example code:
    <telerik:RadScriptManager ID="rsm" runat="server"></telerik:RadScriptManager>
  
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                    <telerik:AjaxUpdatedControl ControlID="ltResult" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>    
      
    Result: <asp:Literal ID="ltResult" runat="server" Text=""></asp:Literal>
    <br />
  
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
            ontabclick="RadTabStrip1_TabClick" SelectedIndex="0" CausesValidation="false">
        <Tabs>
            <telerik:RadTab runat="server" Text="Root RadTab1" PageViewID="RadPageView1" Selected="True">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Root RadTab2" PageViewID="RadPageView2">
            </telerik:RadTab>
        </Tabs>
</telerik:RadTabStrip>
    </div>
    <telerik:RadMultiPage ID="RadMultiPage1" Runat="server" SelectedIndex="0" RenderSelectedPageOnly="false">
        <telerik:RadPageView ID="RadPageView1" runat="server">        
            Tab 1 content:  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfv_TextBox2" runat="server" ControlToValidate="TextBox2" ErrorMessage="Client Error">
                            </asp:RequiredFieldValidator>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server">
            Tab 2 content:            
        </telerik:RadPageView>
    </telerik:RadMultiPage>
protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                ltResult.Text = "page is valid";
            }
            else 
            {
                ltResult.Text = "page is not valid";
            }
        }

If you run this code and click on the second tab, the ltResult control shows "page is not valid".  This is correct as there is a requiredfieldvalidator in the RadPageView.  If you change the value of RenderSelectedPageOnly to "true", the ltResult control shows "page is valid", which is incorrect.

In reality, my page has several RadPageView controls with dynamically loaded usercontrols containing a lot of content.  I need to be able to set RenderSelectedPageOnly="true" to save on bandwidth and client processing time.  Can you tell me how to get this working with RenderSelectedPageOnly="true"?

I am using Version 2010.3.1215.40 of Telerik RadControls for ASP.NET Ajax.

Thanks,

Craig

8 Answers, 1 is accepted

Sort by
0
Craig Wallace
Top achievements
Rank 1
answered on 30 Jun 2011, 04:54 PM
It seems this issue was fixed sometime between Version 2010.3.1215.40 and Version 2011.1.519.40 as it works fine in the latter.

Craig
0
Veronica
Telerik team
answered on 01 Jul 2011, 02:40 PM
Hello Craig Wallace,

This is a known bug in the RadTabStrip which we will fix soon. Thank you for reporting and please acept my apologies for the caused inconvenience.

Best wishes,
Veronica Milcheva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Craig Wallace
Top achievements
Rank 1
answered on 01 Jul 2011, 02:54 PM
Hi Veronica,

Is it not already fixed?  I do not get the same problem in 2011.1.519.40

Craig
0
Veronica
Telerik team
answered on 04 Jul 2011, 09:04 AM
Hello Craig,

Please accept my apologies for misleading you. This one is fixed in version 2011.1 519 as you may see in the Release History:

Fixed: RadMultiPage: RenderSelectedPageOnly property was applied multiple times and too early in the Page Lifecycle, setting non-selected PageViews to Visible=false and causing troubles persisting state of some of the controls inside the views

Regards,
Veronica Milcheva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Rafael
Top achievements
Rank 1
answered on 01 Nov 2011, 09:21 PM
Hi Veronica,

I'm getting the same issue on 2011.2.915.35.

The Validators  that are not in the currently rendered tab are ignored when I call Page.Validate(). Each tab has a user control for content..

Any help with this would be appreciated :)


<telerik:RadTabStrip ID="TabStrip" runat="server" SelectedIndex="0" OnTabClick="TabStrip_TabClick"  MultiPageID="MultiPage" AutoPostBack="true"  CausesValidation="false">
            <Tabs>
                <telerik:RadTab runat="server" Selected="True" Text="Main"  >
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Assessors">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="MultiPage" runat="server" SelectedIndex="0"   AutoPostBack="true"  RenderSelectedPageOnly="true">
            <telerik:RadPageView ID="PageViewMain" runat="server" >
                <uc1:AssessmentMainManage ID="AssessmentMainManage1" runat="server"></uc1:AssessmentMainManage>
            </telerik:RadPageView>
            <telerik:RadPageView ID="PageViewAssessors" runat="server">
                <uc1:CdisSelector ID="CdisSelectorAssessors" SessionFieldForGridDataSource="Assessor" runat="server"/>
        </telerik:RadMultiPage>
0
Dimitar Terziev
Telerik team
answered on 07 Nov 2011, 11:20 AM
Hi Rafael ,

The behavior that you experience is not related to the previously mentioned bug. What you experience as a behavior is the expected one. When your other controls are not rendered on the page it's expected that their validators won't be fired, and the ones which will be fired are the validators in the rendered pageview.

Regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Abhijit
Top achievements
Rank 1
answered on 07 Aug 2012, 01:52 PM
Hi Veronica,
I am getting same problem. I am using 2011.2.915.35 dll.
My issue is -  i have two tabs and each tab is having required field validator and save button outside the tabstrip. When i click save button it fires validator of the current page view but ignores the second one and Page.Isvalid property becomes true. 

But what i want is, when any of the validator fails it shouldnt allow to save.

Please Let me know what has to be done.

Regards,
Abhijit.
0
Helen
Telerik team
answered on 09 Aug 2012, 04:19 PM
Hello Abhijit,

Do you reproduce the issue with the attached page?
If yes - what are the exact steps?


Regards,
Helen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TabStrip
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Craig Wallace
Top achievements
Rank 1
Veronica
Telerik team
Rafael
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Abhijit
Top achievements
Rank 1
Helen
Telerik team
Share this question
or