Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a webpart in sharepoint 2010 with many pages (ControlTemplates) Iam just analize request QueryString "action" param to set active page. In webPart class code looks like (method CreateChildControls):

string ccontrol = _ascxPath;
if (Page.Request.QueryString["action"] == "ServiceRequest") { ccontrol = _RequestPath; }
if (Page.Request.QueryString["action"] == "Bim") { ccontrol = _BimPath; }
if (Page.Request.QueryString["action"] == "BimRequest") { ccontrol = _BimRequestPath; }

Control control = Page.LoadControl(ccontrol);
Controls.Add(control);

In this pages a have a same html blocks, like top usermenu, pagetitle, sidebar , footer and others. I my project a put some root elements on each aspx page, for example:

<div class='quick_links' id="ctrl_quick_links" runat="server"></div>

and then call some helper class to draw menu...

 ctrl_quick_links.Controls.Add(new pViewHelper().mainMenu());

My question is, how i can use one template page for draw this elements?? Like masterpages.. Structure like:

Masterpage

- MyWebpart

-- InternalMasterPate (header, footer, usermenu, sidebars here)

--- WebPart Pages (only content for page)
share|improve this question

migrated from stackoverflow.com Sep 17 '12 at 11:51

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.