Home > Interview Questions > .Net Framework > How to reference the style sheet in the asp.net page?

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

by Thamil   on 14/07/2011   Category: .Net Framework   |  Level: Beginner   |  Views: 1945    |  Points: 25     |  Gold 


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

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!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>Sample Style sheet Reference </title>
<link href="MyStyle.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>



« What is LINQ stands for?
» What is the use of validationSummary control in asp.net application?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts