ASP.NET Web Forms: Master Page and CSS File

I have a project (web application) that I need to implement using Web Forms. I have already prepared the design for the website, and I will use one of the CSS templates that I have already developed. In this case:

  • Should I use the homepage?
  • Is there any connection between the main page and the CSS file? If so, how to identify the main page with the CSS file?

By the way, the CSS file is a ready-made template.

+5
source share
3 answers
  • . . , , !

  • CSS , , . - <link href="~/styles/Style.css" rel="stylesheet" type="text/css" />

, . Visual Studio , .

+9

, (, , , ..).

, CSS, CSS . CSS - ( , ), . CSS , , , ( ContentSection).

+1

I would suggest using master pages to control the overall layout of your site, so you don’t need to repeat the layout on each page. You don’t need to do anything special in the CSS file for the main page account, but you must add the link to the CSS file in the header of the main page so that it is transferred to all pages using the page wizard.

Main page title:

<head runat="server">    
    <link rel="Stylesheet" href="~/pathtocssfile/cssfilename.css" type="text/css" />
</head>
0
source

All Articles