Page.IsValid incorrect when RenderSelectedPageOnly=true in RadMultiPage

9 posts, 0 answers
  1. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 30 Jun 2011 Link to this post

    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

  2. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 30 Jun 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 01 Jul 2011 Link to this post

    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.

  5. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 01 Jul 2011 Link to this post

    Hi Veronica,

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

    Craig
  6. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 04 Jul 2011 Link to this post

    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.

  7. Rafael
    Rafael  avatar
    3 posts
    Member since:
    Jul 2011

    Posted 01 Nov 2011 Link to this post

    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>
  8. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 07 Nov 2011 Link to this post

    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
  9. Abhijit
    Abhijit avatar
    10 posts
    Member since:
    Jun 2011

    Posted 07 Aug 2012 Link to this post

    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.
  10. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 09 Aug 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017