What is the best way to add a cascading stylesheet (CSS) to a web application project in visual studio 2010?
For example if I have the followingL
<asp:Label ID ="lName_lbl" runat="server" text="Last Name: "></asp:Label>
<asp:TextBox ID="lName" runat="server"></asp:TextBox>
<br />
How do i style all asp labels to have the same properties?
You can use the CssClass attribute on your labels or you could define a style to apply to all spans since .NET renders
<asp:Label />
as a span.As the other answers have correctly mentioned, you can use the CssClass attribute for controls that support it.
You can also style the elements using CSS Selectors
ASP.Net makes it easy to add stylesheets to your application via the App_Themes folder. CSS specified in here corresponding to the theme you set in the page or web.config will be automatically loaded. No need to link the css manually.
EDIT:
If you don't already have an App_Themes folder, right click your project, and choose Add->Add ASP.Net Folder->Theme and this will create it for you. To make sure the Theme is used set it in the web.config (via the <pages theme="" attribute) or at the page level. See the App_Themes page for more information.
ASP.NET controls have the CssClass property which you can use to style your control. There's also some good advice on using CSS with ASP.NET here.