ASP.NET Custom Control Styling

I am working on several ASP.NET user controls. I was interested to know if I can contribute to your thoughts on boys and girls about how you apply style to your controls.

I would rather push it like this in CSS, so for a few controls that I did in the past, I just ran a string property that allows you to enter a string that is then included in the “style” attribute when rendering, I know that I could would also use the CSSClass property and apply the class attribute.

I haven’t done much to create the “right” Style property (in which you actually save the style object and use the constructor to specify its values). This seems to be a lot of work for me, and TBH, I hate the style editor interface and really prefer to enter a CSS / class name.

What do you think about this?


Note: This is subjectively subjective - so clear:

The accepted answer would be:

  • Pro and con offers different approaches.
  • Opinions are welcome, but a good answer should be constructive.
  • Backup with some real knowledge / experience.

nothing. , , .

→ < < "" - . "" - , . , .

+3
2

, . , VS IDE , .

, , , , , , .

, , CSSClass.

- , , , , / IDE.

+3

, " " , , , .

, : , .

, , . : ASP.NET, SiteMapPath, Menu, Treeview. , , , .

+2

Source: https://habr.com/ru/post/1696936/


All Articles