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

I want to extend the control AspMenu of sharepoint 2010 but as the classe is sealed I cannot derive from it. The AspMenu derives from Microsoft.SharePoint.WebControls.Menu, my question is can I derive from it and get approx the same menu rendered? I tried deriving from this class and I deploy the control without changing anything, so normally it should render the basic, but I don't get anything renderd, what am I doing wrong?

I also tried deriving from System.Web.UI.WebControls.Menu and in the method OnPreRender putting:

SiteMapDataSource dataSource = this.GetDataSource() as SiteMapDataSource;
SiteMapProvider provider = (dataSource != null) ? dataSource.Provider : null;

Renders a menu, but the menu is not very good build, the OOTB menu is builded used the unordered lists, but this one is build using the table and also there is no highlighting based on the current page. And if i start to overriding render method nothing is rendered at all.

But anyways, does anyone know how can I solve this issue? In complete picture, I want to override render method, so the first node is rendered as image istead of text link. How can I get this done? And how can I derive from Microsoft.SharePoint.WebControls.Menu and get the control working to render the links?

share|improve this question

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.

Browse other questions tagged or ask your own question.