Add iframe in pageview dynamically

4 posts, 0 answers
  1. Rajesh Venkataraman
    Rajesh Venkataraman avatar
    8 posts
    Member since:
    Jun 2008

    Posted 06 Nov 2008 Link to this post

    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> 

  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 11 Nov 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Safa Amini
    Safa Amini avatar
    12 posts
    Member since:
    Apr 2010

    Posted 04 Feb 2011 Link to this post

    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
  5. Patrick
    Patrick avatar
    4 posts
    Member since:
    Jun 2016

    Posted 14 Jun in reply to Safa Amini Link to this post

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

     

    Regards,

    Patrick

     

     

Back to Top