R
Ron
Hi all,
I've come across a problem when casting user controls in ASP.NET 2.0,
hopefully someone can help. I have a master page with a user control on
it (myMenu) that I wish to programmatically access from a content page.
Below is how I am trying to do this (this would work in ASP.NET 1.1).
DynamicMenu myMenu =
(DynamicMenu)((MasterPage)this.Master).FindControl("myMenu");
myMenu.initialise(enterpriseId);
However it doesn't work in 2.0 because I can't reference the user
control type DynamicMenu in code. I've tried adding the control to a
namespace, through which I could reference it, but apparently you can't
do this now.
Does anyone know how I could get this to work, or another way of doing
the same thing?
Thanks and Regards,
Ross
I've come across a problem when casting user controls in ASP.NET 2.0,
hopefully someone can help. I have a master page with a user control on
it (myMenu) that I wish to programmatically access from a content page.
Below is how I am trying to do this (this would work in ASP.NET 1.1).
DynamicMenu myMenu =
(DynamicMenu)((MasterPage)this.Master).FindControl("myMenu");
myMenu.initialise(enterpriseId);
However it doesn't work in 2.0 because I can't reference the user
control type DynamicMenu in code. I've tried adding the control to a
namespace, through which I could reference it, but apparently you can't
do this now.
Does anyone know how I could get this to work, or another way of doing
the same thing?
Thanks and Regards,
Ross