Ibrahim Najjar
Ibrahim Najjar

Reputation: 19423

Combining ASP.NET controls with CSS

I am relatively new to website design and specifically working in ASP.NET, i am using CSS to style my site, but when i use ASP.NET Controls like GridView, Navigation controls, etc ... they are messed up by the style sheets, and you can't see that until you run the website, because the controls are translated to HTML and so affected by CSS in a way that you can't predict, how to solve this, and is there a better way to layout and desgin sites in ASP.NET.

Upvotes: 0

Views: 500

Answers (2)

KodeKreachor
KodeKreachor

Reputation: 8882

A great method that's worked well for me is to create Skins for your ASP.NET controls.

http://msdn.microsoft.com/en-us/library/ykzx33wh.aspx

http://www.asp.net/web-forms/videos/how-do-i/how-do-i-use-skins-with-css-for-a-flexible-and-maintainable-aspnet-web-site

After getting my skins and CSS classes created for the different pieces of my ASP.NET controls I'll then run my app in a browser with good developer tools, Google Chrome has a stellar set of dev tools that allow you to modify your css classes and styles right in the page so you can see the results immediately. I'll then update my Skin CSS classes to match the styles I created using the browser dev tool.

Upvotes: 1

Antonio Bakula
Antonio Bakula

Reputation: 20693

You can use ControlAdapters or better use ASP.NET MVC

Upvotes: 2

Related Questions