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"

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

See solution at siderite blog
http://siderite.blogspot.com/2009/07/popendtag-was-called-without.html

Comments

  1. The new URL for the solution can be found at https://siderite.dev/blog/a-popendtag-was-called-without.html

    ReplyDelete

Post a Comment

Popular posts from this blog

Mobile development opportunities

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes