Passing html markup into an ASP.NET User Control

前端 未结 1 1094
终归单人心
终归单人心 2020-12-18 05:01

In the following example,



   

this is html

How do I access \

相关标签:
1条回答
  • 2020-12-18 05:14

    In typical WebForms controls, the HTML will be automatically put into a Literal control in MyUserControl's Controls collection. Controls with template properties work a little differently, but you may still be able to access this in a similar way through the property whose name you're using (e.g. MessageTemplate).

    MVC works totally differently, and I don't know if there's a way to do what you're asking there. You may want to consider using javascript to analyze what actually gets rendered client-side if it doesn't work for you.

    0 讨论(0)
提交回复
热议问题