Thursday, August 19, 2010

PopEndTag was called without a corresponding PushEndTag

I came across this error when overriding the menu class to make SharePoint navigation CSSFriendly. CSSFriendly control adapters from CodePlex are not an option, since control adapters change all navigation controls (horizontal and vertical) for all SharePoint sites and admin zones throughout the given application pool.

public class MossMenu:System.Web.UI.WebControls.Menu

Method to override:
- RenderBeginTag
- RenderContens
- RenderEndTag

After all errors removed and deploying solution, I get:
"PopEndTag was called without a corresponding PushEndTag"

The solution is to add the render method so it mentions all methods:
protected override void Render(HtmlTextWriter writer)
  if (this.Page != null)
  if (this.Items.Count > 0)

See solution at siderite blog

No comments:

Post a Comment