-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add methods to TagBuilder to render the tags only #5689
Comments
@sebastienros the problem here is the |
This is another good reason to expose specific rendering methods, that don't use the |
@sebastienros - is this something you'd like to send a PR for? If not, we will close this. |
Then I will, thanks. |
Not sure how much "design" there is to do here, but I like the idea of adding |
Not that easy after talking with @dougbu because of the bufferization.
|
… except |
I am using a
TagBuilder
to create tags dynamically in a view. In MVC5 we could render the start and end tags independently with the same tag builder without having to render the content. If the content is part of the razor view it can't be added to the instance of the tag builder as it needs to be set withInnerHtml
.A solution that I'd like would be to add two methods,
RenderStartTag()
andRenderEndTag()
.I have tried to use the
TagRenderMode
without success, it renders the end tag twice.It results in
Ideally I could just write:
Or with a syntax that would capture the razor output:
The text was updated successfully, but these errors were encountered: