This is a migrated thread and some comments may be shown as answers.
RadMultiPage with ContentUrl - how to access parent page controls
10 Answers 181 Views
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 28 Feb 2011, 11:48 AM
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.

10 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 28 Feb 2011, 12:18 PM
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!
0
john
Top achievements
Rank 1
answered on 28 Feb 2011, 12:46 PM
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
0
john
Top achievements
Rank 1
answered on 01 Mar 2011, 01:30 PM
Anyone can help me, please? Is it possible from server-side code?
Thanks.
0
Accepted
Veronica
Telerik team
answered on 02 Mar 2011, 04:26 PM
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!
0
john
Top achievements
Rank 1
answered on 02 Mar 2011, 04:37 PM
Ok, thanks for your help.
0
Tomica
Top achievements
Rank 2
answered on 13 Oct 2012, 05:06 PM
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 $.
0
Tomica
Top achievements
Rank 2
answered on 13 Oct 2012, 05:06 PM
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 $.
0
Nencho
Telerik team
answered on 18 Oct 2012, 09:56 AM
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.
0
Tomica
Top achievements
Rank 2
answered on 18 Oct 2012, 07:45 PM
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.
0
Edgar
Top achievements
Rank 1
answered on 27 Feb 2013, 11:54 PM
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



Asked by
john
Top achievements
Rank 1
Answers by
Veronica
Telerik team
john
Top achievements
Rank 1
Tomica
Top achievements
Rank 2
Nencho
Telerik team
Edgar
Top achievements
Rank 1
Share this question
or