Master Page Content and MultiPage ClientID issues

This post has 2 replies

Not Ranked
Posts: 1
vdavi Posted: Mon Mar 13, 2006 @ 1:41 PM
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:
ctl001_ContentMain_MultiPage1

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:
ctl001$ContentMain$MultiPage1

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.


-Vinny Davi
Top 10 Contributor
Posts: 806
jovan Posted: Tue Mar 21, 2006 @ 4:44 PM
If you haven't resolved this issue yet, I suggest you open a support request about it.

(In general, we guarantee a timely response to support requests, whereas the forums are mostly a community resource that we only monitor informally.)
Top 500 Contributor
Posts: 29
derek.thornton Posted: Mon Apr 17, 2006 @ 4:58 PM
I would be interested in any resolution to this problem, as well.
Page 1 of 1 (3 items)