Home > Code > ASP.NET > How to reference the style sheet in the asp.net page?

How to reference the style sheet in the asp.net page?

by Narain Siddharth   on Aug 29, 2011   Category: ASP.NET   |  Views: 1509    |  Points: 25   |  Silver 


We can use HTML link element to reference the style sheet in the asp.net web form. Include the below link element inside <head>… <head/> tag

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm6.aspx.cs" Inherits="WebApplication1.WebForm6" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Reference Style sheet</title>
<link href="MyStyle.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>





Post Code  |  Code Snippet Home

Recent Posts

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts