A PopEndTag was called without a corresponding PushEndTag

  • Thread starter Thread starter TJS
  • Start date Start date
T

TJS

can any one help with this error message ? What's missing ?

"A PopEndTag was called without a corresponding PushEndTag"

==============offending code to generate droplist ====================
......

writer.AddAttribute(HtmlTextWriterAttribute.Id, name)
writer.AddAttribute(HtmlTextWriterAttribute.Name, name)
writer.RenderBeginTag(HtmlTextWriterTag.Select)

while dtr.read

writer.AddAttribute( HtmlTextWriterAttribute.Value, dtr(0) )
If colEditValues(name) = dtr(0) Then
writer.AddAttribute(HtmlTextWriterAttribute.Selected, "SELECTED")
End If

writer.RenderBeginTag(HtmlTextWriterTag.Option)
writer.Write(dtr(1))
writer.RenderEndTag()

end while

writer.RenderEndTag()


........
 
can any one help with this error message ? What's missing ?

As far as I can tell, what's missing is the offending code. The code you
posted by itself is fine. Other than the fact that you're not using Option
Strict. So, I can't tell what exactly is going into your HTML.

You call RenderBeginTag for the Select object. Then you create each option,
calling RenderBeginTag and RenderEndTag with each one. Finally, you call
RenderEndTag on the Select object. In this block, all the PopEndTags have
PopPushTags.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
Back
Top