I am using the 2006 latest release of Web.UI for .NET 2.0
I have created a master page with 2 ContentPlaceHolder controls. Within the aspx page that uses that master page, I am placing a ComponentArt:Menu in one Content Control and a ComponentArt:MultiPage within the other Content Control. The MultiPage control has several PageView controls within it.
I set the Menu Control MultiPageId attribute value to "MultiPage1" which is the Id for the MultiPage Control. When I run the web application I receive the following error:
Target MultiPage control (MultiPage1) not found on the page.
So after reading a few Knowledgebase articles here and several forum posts, I realize that the ClientControlID gets changed on the client side to something unique, due to the way controls within a Content Control are generated by ASP.NET. This control clientid becomes:
So in the Page_Load event of the aspx page, I do the following:
this.Menu1.MultiPageId = MultiPage1.ClientObjectId
It turns out, this does not help, because the ClientObjectID of the MultiPage1 Control is actually getting changed to this:
so, I can create an even bigger hack by putting this into the Page_Load event:
this.Menu1.MultiPageId = MultiPage1.ClientObjectId.Replace("_","$");
Then everything works. The reason for me using Content controls is I want to create a well structured , easy to maintain web application. At this early stage, it already seems I need to implement hacks to get things to work properly. My question is, do I absolutely have to implement hacks like this, or is there some flaw in my design? Is there an easier way? Any thoughts / help would be appreciated. Thank you.