Hi,
Let me see if I understood your problem
You have a scenario like this:
+------------
| Master Page 1
|
[quoted text clipped - 3 lines]
| | +----------
| | | Content Page
And you're trying to access from Content Page a control on the Master
Page 1. Am I correct?
If so, I think you can do the following
Private Sub ContentPage_Load(sender as Object, e as EventArgs) Handles
Me.Load
Dim mp2 As MasterPage = Me.Master
Dim mp1 As MasterPage = mp2.Master
Dim btn1 As Button = CType(mp1.FindControl("btnMaster1"),
Button)
Dim btn2 As Button =
CType(mp1.FindControl("ContentPlaceHolder1").FindControl("btnMaster2"),
Button)
btn1.Text = "MP1 Changed from Content Page"
btn2.Text = "MP2 Changed from Content Page"
End Sub
I've put up a sample test project at http://rapidshare.com/files/99551862/NestedMasterPage.zip.html
Anyways, the problem is that when using nested Master Pages, the
hierarchy is created on the top most Master Page.
And as you can see by the code snippet the ContentPlaceHolder is build
into the hierarchy.
Regards,
Paulo Santos
http://pjondevelopment.50webs.com
> Thanks,
>
[quoted text clipped - 46 lines]
>
> - Show quoted text -
clintonG - 15 Mar 2008 04:27 GMT
Which is why enabling trace is so useful for referencing controls.
<%= Clinton Gallagher
Hi,
Let me see if I understood your problem
You have a scenario like this:
+------------
| Master Page 1
|
[quoted text clipped - 3 lines]
| | +----------
| | | Content Page
And you're trying to access from Content Page a control on the Master
Page 1. Am I correct?
If so, I think you can do the following
Private Sub ContentPage_Load(sender as Object, e as EventArgs) Handles
Me.Load
Dim mp2 As MasterPage = Me.Master
Dim mp1 As MasterPage = mp2.Master
Dim btn1 As Button = CType(mp1.FindControl("btnMaster1"),
Button)
Dim btn2 As Button =
CType(mp1.FindControl("ContentPlaceHolder1").FindControl("btnMaster2"),
Button)
btn1.Text = "MP1 Changed from Content Page"
btn2.Text = "MP2 Changed from Content Page"
End Sub
I've put up a sample test project at
http://rapidshare.com/files/99551862/NestedMasterPage.zip.html
Anyways, the problem is that when using nested Master Pages, the
hierarchy is created on the top most Master Page.
And as you can see by the code snippet the ContentPlaceHolder is build
into the hierarchy.
Regards,
Paulo Santos
http://pjondevelopment.50webs.com
On Mar 14, 11:31 am, "Torben Laursen" <d...@not.work> wrote:
> Thanks,
>
[quoted text clipped - 52 lines]
>
> - Show quoted text -