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

Add iframe in pageview dynamically

3 Answers 365 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Rajesh Venkataraman
Top achievements
Rank 1
Rajesh Venkataraman asked on 07 Nov 2008, 01:16 AM

Hi,

I am trying to add tabs, pageviews dynamically, and then iframes  in the pageviews.  However, on postback, the iframes are not persisted.

 

 

HtmlGenericControl iframe = new HtmlGenericControl("iframeA");

 

PageView pageView = new PageView();


pageView.Controls.Add(iframe);
multiPage.PageViews.Add(pageView);

However, if i statically do it (as below), the iframes are persisted.  Can you please show me a way to make this work.

Thanks,
Raj

 

 

<telerik:RadPageView id="Pageview2" runat="server" >
                                <iframe  id="ContentIframe2" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview3" runat="server" >
                                <iframe  id="ContentIframe3" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview4" runat="server" >
                                <iframe  id="ContentIframe4" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview5" runat="server" >
                                <iframe  id="ContentIframe5" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 11 Nov 2008, 02:59 PM
Hello Rajesh,

You should use the PageViewCreated event to persist the dynamically created controls inside a RadPageView.

All the best,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Safa Amini
Top achievements
Rank 1
answered on 04 Feb 2011, 08:58 PM
Hello

I have a similar situation: there is a button on the page which adds a tab with its pageView into which an IFrame and an aspx page is loaded and the user starts entering some data into its fields. In the middle of this, the user may decide to load another form into a new tab in the same way and fill out some other form. Upon doing this, the IFrame in the first tab disappears. I know that PageViewCreated must be used to "re-load" the page views with each postback, but that is exactly what I want to avoid: valuable data in the first form must be preserved between postbacks. I have used an ajax manager for the whole tabstrip-pageView package (which will not help in this case).

What I probably need is a way to ask the RadMultiPage to only add the new pageview (through a limited ajax call) and leave the rest of the page views untouched. Maybe I can ask the ajax manager to exclude the previously added page views (and the containing IFrames and pages) and only update the tabStrip and add the new page View.

Please advise.

Thank you very much
Safa
0
Patrick
Top achievements
Rank 1
answered on 15 Jun 2016, 03:15 AM

I'm facing exactly the same problem . Do you have any solutions? Thanks.

 

Regards,

Patrick

 

 

Tags
TabStrip
Asked by
Rajesh Venkataraman
Top achievements
Rank 1
Answers by
Paul
Telerik team
Safa Amini
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Share this question
or