How to make user controls know about css classes in ASP.NET

后端 未结 4 656
青春惊慌失措
青春惊慌失措 2020-11-28 22:10

Since there are no header sections for user controls in asp.net, user controls have no way of knowing about stylesheet files. So css classes in the user controls are not rec

4条回答
  •  失恋的感觉
    2020-11-28 22:23

    If you are creating composite UserControl, then you can set the CSSClass property on the child controls..

    If not, then you need to expose properties that are either of the Style type, or (as I often do) string properties that apply CSS at the render type (i.e. take them properties and add a style attribute to the HTML tags when rendering).

提交回复
热议问题