TagBuilder InnerHtml in ASP.NET 5 MVC 6

后端 未结 6 974
难免孤独
难免孤独 2021-02-07 01:10

It seems to me that there are major breaking changes in TagBuilder as of beta7 with no mention about them in the announcements repo.

Specifically .ToString no longer ren

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-07 02:00

    Using MVC 6, at the time of writing, Tagbuiler.InnerHtml has indeed no setter anymore. It has some methods instead to append the element. For instance you could write:

    var container = new TagBuilder("div");
    var input = new TagBuilder("input");
    
    container.InnerHtml.AppendHtml(input);
    

提交回复
热议问题