C# – Use of css in asp.net

asp.netccssvisual studio 2010

I have a doubt that in asp.net I am using CssClass class attribute for web server controls. And i am writing all the css code in style.css which will be in style folder of my project

    <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>

The above is the example of the textbox.

Now the question is do i need to use link tag to say that my css file is located in style folder of my project?

Best Answer

Yes, you have to link the style sheet file (.css) by adding the link tag.

You can also simply drag the css file into the html section of the .aspx code right under head tag, that will work too - that will create the link for you.

See the image below