Loading contentURL Page

3 posts, 0 answers
  1. Leonard Jones
    Leonard Jones avatar
    19 posts
    Member since:
    Feb 2006

    Posted 04 Aug 2011 Link to this post

    I have a main web page that contains a tabstrip with two tabs and two corresponding pageViews. The contents of each pageView has a contentURL value e.g. Tab1.aspx and Tab2.aspx. When the main web page loads the the contents of the Tab1.aspx is displayed. So far, so good. The main page also contains some script which interacts with the contents of Tab2.aspx. When I run this when the main page is first loaded, it fails to find the document in Tab2.apx. I then click on Tab2 and the contents of Tab2.aspx is shown. If I re-run the test then the script works fine.

    I suspect that the pageView associated with Tab2 is not created until the tab is clicked. Is there a method of creating the pageView associated with a tab when its containg page is first loaded?

    Many thanks for this and all the previous problems I have submitted.

    Len Jones
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 05 Aug 2011 Link to this post

    Hello Leonard,

    I would have to assume it's a timing issue, where the first page completes loading before the second page is loaded, so it can't find the elements in the other page because it has not loaded completely, thus the reason it works correctly when you re-run the test.

    I would have to assume that is the reason why it doesn't work. Have you tried waiting a couple minutes after the first page loads and seeing if the test works then. That would hopefully give enough time for the second page to load completely.
  3. Dimitar Terziev
    Dimitar Terziev avatar
    1266 posts

    Posted 08 Aug 2011 Link to this post

    Hello Leonard,

    The reason for the experienced behavior is the following. When you use the ContentUrl property of the RadPageView its content is rendered in an iframe. When this pageview is shown for the first time a "Get" request is made in order the content of the page which is referenced by url to be loaded. In your case you are trying to manipulate a content which is not yet loaded since you haven't selected the second tab in order its pageview to make a request for its content. If you want the content of all pageviews to be loaded at once you should use user controls, not referencing a page with the ContentUrl property.

    Best wishes,
    Dimitar Terziev
    the Telerik tea

    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.

Back to Top