views:

93

answers:

1

By default VS 2010 likes to put CSS in-line, I'm wondering if there is a way to force it to put the CSS into a css file instead?

+2  A: 

Are you referring to the inline styles that controls use in asp.net webforms??

If so, then the following can help, but may not fix all of the problems.

Don't use any of the style properties for the control, other than to set the class property to a class name that resides in your css file. Unfortunately this does depend on how the control is actually rendered in the html, so this will probably not work for everything. Fortunately they were supposed to have cleaned up the controls quite a bit with vs2010, but I haven't had the chance to try it out yet.

Also asp.netmvc doesn't have the control problem since you have full control over how everything is rendered. That may be a more flexible option assuming you don't already have legacy code hanging around.

mwgriffith