RadMultiPage with ContentUrl - how to access parent page controls

11 posts, 1 answers
  1. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 28 Feb 2011 Link to this post

    Hi,
    I'm trying to use RadMultiPage in this context:
    - there is a main page (Main.aspx), with a Treeview and a Multipage that uses ContentUrl property for loading the content.
    - the Treeview has three different types (levels) of nodes, and when I select a node I load a page of the Multipage according to the type of node (PageNodeType1.aspx, PageNodeType2.aspx, PageNodeType3.aspx).

    I want to access the TreeView in Main.aspx from any of the pages loaded in Multipage (PageNodeType1.aspx, ...) but I don't know how to do it (really I don't know if it's possible).

    Could you help me? Thanks in advance.
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 28 Feb 2011 Link to this post

    Hi john,

    I'm not quite sure if I got your logic for the structure of the page.
    Could you please send me your code so I can inspect it and help you?

    Regards,
    Veronica Milcheva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 28 Feb 2011 Link to this post

    Here you've a more simple sample:
    - a main page (Main.aspx) with a textbox, two buttons and a RadMultiPage with two PageView (pageViewContent1 and pageViewContent2) that uses ContentUrl property for loading its content.
    - two additional pages, PageContent1.aspx and PageContent2.aspx.

    First button in MainPage.aspx selects pageViewContent1 for loading PageContent1.aspx, and second button selects pageViewContent2 for loading PageContent2.aspx.

    Is it possible to modify the Main.aspx textbox text from PageContent1.aspx or PageContent2.aspx server code once it has been loaded in its corresponding PageView?
    Is it possible to access any kind of control in Main.aspx from an .aspx page loaded in a PageView using ContentUrl?

    Here's part of the code:
    - Main.aspx:
        <div>
            <asp:TextBox ID="txtMainTextbox" runat="server"></asp:TextBox>       
           <asp:Button ID="btnContent1" runat="server" onclick="btnContent1_Click" Text="Load Content1" />
            <asp:Button ID="btnContent2" runat="server" onclick="btnContent2_Click" Text="Load Content2" />      
            <telerik:RadMultiPage ID="multiPage" Runat="server">
                <telerik:RadPageView ID="pageViewContent1" runat="server" ContentUrl="~/PageContent1.aspx">
                </telerik:RadPageView>
                <telerik:RadPageView ID="pageViewContent2" runat="server" ContentUrl="~/PageContent2.aspx">
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </div>

    - Main.aspx.cs:
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                multiPage.SelectedIndex = 0;
        }
        protected void btnContent1_Click(object sender, EventArgs e)
        {
            multiPage.SelectedIndex = 0; //load PageContent1.aspx
        }
        protected void btnContent2_Click(object sender, EventArgs e)
        {
            multiPage.SelectedIndex = 1; //load PageContent2.aspx
        }

    - PageContent1.aspx:
        <div>  
            Page with Content1<br />
            <asp:Button ID="btnChangeParentText" runat="server"
                onclick="btnChangeParentText_Click" Text="Change Parent Textbox" />
        </div>

    - PageContent1.aspx.cs:
        protected void btnChangeParentText_Click(object sender, EventArgs e)
        {
            //access Main.aspx txtMainTextbox and change its Text property ¿¿??
        }

    Regards,
    John
  5. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 01 Mar 2011 Link to this post

    Anyone can help me, please? Is it possible from server-side code?
    Thanks.
  6. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 02 Mar 2011 Link to this post

    Hi john,

    Unfortunately this is not possible as the two pages Main.aspx and the pages in the ContentUrl has no relationship between them. The ContentUrl property is used only for displaying of pages with absolute or relative Url.

    Best wishes,
    Veronica Milcheva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 02 Mar 2011 Link to this post

    Ok, thanks for your help.
  8. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 13 Oct 2012 Link to this post

    I have a slightly different question, no need to access controls between pages.
    Rather, I use ContentURL to embed various page overlays, loading the PageView content with all the parameters that I need.
    In the child (embedded) page I would like to know two things:

    1) in VB.Net, is there a way for that page to determine that it is embedded inside another? (maybe this is an iFrame?)
    2) If possible, then can I deternine the name of the containing page?

    Basically I want to adapt that page to various environments. The content is such that conversion to a custom control is not feasible, too many pages, too little budget $.
  9. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 13 Oct 2012 Link to this post

    I have a slightly different question, no need to access controls between pages.
    Rather, I use ContentURL to embed various page overlays, loading the PageView content with all the parameters that I need.
    In the child (embedded) page I would like to know two things:

    1) in VB.Net, is there a way for that page to determine that it is embedded inside another? (maybe this is an iFrame?)
    2) If possible, then can I deternine the name of the containing page?

    Basically I want to adapt that page to various environments. The content is such that conversion to a custom control is not feasible, too many pages, too little budget $.
  10. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 18 Oct 2012 Link to this post

    Hello John,

    Unfortunately, you can not determine whether the page is embedded inside another or in a certain iFrame at server-side. As for your second question, could you elaborate a bit more about the scenario you are trying to achieve?

    All the best,
    Nencho
    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.
  11. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 18 Oct 2012 Link to this post

    First, I now understand what is goin on with the embedded page (iFrame) and anything at the client level is well beyond my technical competency. I think I can adjust the calling parameters to provide what is needed, just not quite a elegant as one instance of "who's my daddy?".

    Long-term, I think I should explore converting to custom controls.

    As for the second question, since my embedded page cannot know that it is embedded, the name of the "parent" page is irrelevant, so we can scratch that query.

    I think we can close this thread as "close enough to what I need", thanks.
  12. Edgar
    Edgar avatar
    4 posts
    Member since:
    Nov 2012

    Posted 27 Feb 2013 Link to this post

    i need to do something simpler than the original questions here.

    Is there a way to open a url at the main.aspx from a click or url or other control of the content.aspx??

    lets put it as simple as posible

    a got main.aspx with a tabs and multipage components

    it load content1.aspx and content2.aspx

    i got a button at content1.aspx and i want to reload the main.aspx with other url when yo click the content1.aspx button

    hope is this clear any help is appreciated



Back to Top
UI for ASP.NET Ajax is Ready for VS 2017