Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
hi. it's a aspx file without codebehind.and in design veiw there is css classes.
how can i add this page to other pages'header?

a detail of this code:
ASP.NET
<%@ Page %>

BODY { 
	font-size:8pt; font-family:tahoma;
	scrollbar-face-color:#E5E5E5;
	margin:0px;
	padding:5px;
	background-attachment: fixed;
	background-repeat: no-repeat; 
	background-color:#F8F8F8;
}

TABLE {
	font-size:8pt;
	font-family:tahoma;
}

FORM {
	margin:0px;	
}

TH {
	background-color: #ffffff;
	color:#000000;
}



.containerDiv {
	width:100%;
	height:100%;
	direction:ltr;
}


.errorMessage {
	font-size:8pt;
	font-weight:bold;
	color:firebrick;
}

.ellipsis {
	text-overflow:ellipsis;
	overflow:hidden;
}

.note {
	text-align:middle;
	padding-left:20px;
	padding-right:20px;
	font-weight:600;
	color:firebrick;
}
Posted
Updated 26-Mar-23 20:57pm

Example:
C#
................
<head id="Head1" runat="server">

<style type="text/css">
.containerDiv {
	width:100%;
	height:100%;
	direction:ltr;
}
.errorMessage {
	font-size:8pt;
	font-weight:bold;
	color:firebrick;
} 
.ellipsis {
	text-overflow:ellipsis;
	overflow:hidden;
} 
.note {
	text-align:middle;
	padding-left:20px;
	padding-right:20px;
	font-weight:600;
	color:firebrick;
}
</style>
</head>

Regards..:laugh:
 
Share this answer
 
if you want to give reference of this css then make css file and give link to pages which are you want.

give link in this way...:)

suppose your css file name is mystyle.css
your css filepath is text/css then link will be,
HTML
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
 
Share this answer
 
v2
Hi,

Keep the classes and all the css related things to a separate .css file and refer the file to all the pages. Like:
<linkhref="../CLASSIC/main.css" type="text/css" rel="stylesheet"/>

Then this will be available to all the files.

refer:
Adding the css to the aspx page
how to add css code into asp.net website

Thanks
 
Share this answer
 
v3
If you want these CSS on just one page, you will have to embed them inside style tag:
XML
<style type="text/css">
    //CSS statements goes here
</style>


If the styles are common for many pages, add a new CSS file (it shall have .css extension) to your project and move these styles to that file.
Then you reference the CSS file in the head section of your web page like this:
<link href="CSSFileName.css" rel="stylesheet" type="text/css" />


Hope that helps!
 
Share this answer
 
thanks you all. i know all above ways. i was looking for a way referecne original asp page( include just css tags).i think there is not any.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Feb-14 22:02pm    
Not an answer. Such posts are considered as abuse. Please use comments or "Improve question" instead.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900