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

Loading contentURL Page

2 Answers 77 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Leonard Jones
Top achievements
Rank 1
Leonard Jones asked on 04 Aug 2011, 03:06 PM
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 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 05 Aug 2011, 01:24 PM
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.
0
Dimitar Terziev
Telerik team
answered on 08 Aug 2011, 10:33 AM
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.

Tags
TabStrip
Asked by
Leonard Jones
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Dimitar Terziev
Telerik team
Share this question
or