What is LiteralControl? Why is it used?

前端 未结 7 2394
暖寄归人
暖寄归人 2020-12-15 06:11

What is a LiteralControl? I was reading about LiteralContols but I am not sure why they are used. I used this code to list the controls in a page and - I have

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 06:42

    From MSDN Literal Control represents HTML elements, text, and any other strings in an ASP.NET page that do not require processing on the server.

    Also have a look at this for Literal Control usage

    A label renders a tag. It allows you to programmatically change the display characteristics of some text you want to display. A LiteralControl renders exactly whatever static HTML you want it to. There is no general advantage of using one over the other. One may be more useful than another in certain circumstances. For example, if you want to display static text, and make no programmatic changes to it, you might want to use a LiteralControl.

提交回复
热议问题