views:

157

answers:

1

Hi, How can I create a helper like the Html.Form helper, which closes the tag when you close the braces?

+2  A: 

It needs to implement IDisposable and render the closing brace in the Dispose method. You can then have the same using behavior as with the HtmlForm helper.

James Kolpack
How can I render my end tag? since I wont be just returning a string anymore, do I have to write in to the response directly?
ryudice
Yeah, see here http://stackoverflow.com/questions/2435898/create-extension-method-to-produce-open-closing-tags-like-html-beginform
James Kolpack