|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to use ASP to INCLUDE a CSS into the resulting file?
I use ASP to generate a report so it's all server-side.
What we offer is we let users save the resulting report in the HTML format. However once they do that and open the report that's been saved locally, all the formatting is gone. That is of course because of the line <LINK rel=stylesheet type="text/css" href="./css/report.css"> When saved to a local drive, of course report.css doesn't get saved, so all formatting is gone. Sending them this report.css file and asking them to create a "css" directory in which to store the file is NOT an option. Therefore, what I'm after is a way to include the entire report.css file together as the output of the report. So when you view the source of the report, instead of seeing <HEAD> <TITLE>Test Report</TITLE> <LINK rel=stylesheet type="text/css" href="./css/report.css"> </HEAD> You'll actually see: <HEAD> <TITLE>Test Report</TITLE> <STYLE> BODY { FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: Arial, Verdana, 'MS Sans Serif' } </STYLE> </HEAD> Of Course, the report.css does not have the <STYLE> and </STYLE> tags, so I still have to add that manually. So what I think I have so far is this: response.write "<HEAD>" response.write "<TITLE>Test Report</TITLE>" response.write "<STYLE>" [THIS IS THE PART I'M MISSING] response.write "<STYLE>" response.write "</HEAD>" So basically I'm trying to see if there's a way to include the entire file in another file. Can someone give me a hint with this missing part? Any help is greatly appreciated. Thanks a lot King |
|
#2
|
|||
|
|||
|
HI there,
Never mind. I found the solution. Thx for reading |
|
#3
|
||||
|
||||
|
You could do it like this
Code:
<!--#include file="myStyleSheet.css" -->
<%
Response.write("<span class=""myStyleClass"">HELLO</span>")
%>
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > How to use ASP to INCLUDE a CSS into the resulting file? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|