Jump to content

How can I configure the output formatting of Response.Write systemwide?


Bahman

Recommended Posts

Currently, all my outputs via Response.Write asp command are in Times New Roman size 3. How can I changes the systemwide default with something else such as Arial with font size 2?I know CSS Tworks for the html part. But not for the output displayed by Response.Write command or <%=xyx%>. For example, let sayvalue1 = "Test font"Both <%="value1"%> andResponse.Write value1 output: Test font with Times New size 3. I could make it to work by adding (e.g. example):<font style="arial" size="2"><%="value1"%></font>before every single output command, but it is too much and not acceptable. How can I output via lets say <%="value1"%> that the result shows with different style such as Arial and font size=2 systemwide.

Link to comment
Share on other sites

Using CSS, you can specify the default font for the body or for all elements:For the body (and everything else in it...)

body { font-family: arial; font-size: 11px; }

or for every element on the page

* { font-family: arial; font-size: 11px; }

Otherwise, you'll have to wrap the output in an HTML element. Something like this:

<p><%="value1"%></p>

Link to comment
Share on other sites

Using CSS, you can specify the default font for the body or for all elements:For the body (and everything else in it...)
body { font-family: arial; font-size: 11px; }

or for every element on the page

* { font-family: arial; font-size: 11px; }

Otherwise, you'll have to wrap the output in an HTML element. Something like this:

<p><%="value1"%></p>

----------------------------With CSS I need to create a CSS file and then go to every single page and include this file between the <head></head> and so on. Even if I don't need or use html tag in my page. let's say I have a single simple asp page as follow:======================<%@ LANGUAGE="VBSCRIPT" %>a= 2b= 3c = a*bResponse.Write c======================The result of c which is 6 is currently output with Times New Roman size 3 (12pt). How can I configure (what?) to show the result in different formatting style. If you notice, I have only 2 lines of programming and I don't think it justifies using css method.The better way to ask my question is: Q1: is there anyway to change the style systemwide automatically for all pages? how?Q2: how to change the Browser default formatting?
Link to comment
Share on other sites

In firefox, you can choose Tools->Options to load up the browser options. Then on the "General" tab, there's a place where you can specify the default font. I'm sure there is something similar in IE. However, this is only going to change the way your particular browser displays the content. If you would like to be able to make it so that all browsers viewed the content in Arial font rather than Times New Roman, then you'll have to use HTML and/or CSS. Otherwise, the viewer's browser will look at the content as plain-text and display it however that browser is currently set up to display it.

Link to comment
Share on other sites

Go to your ASP page that you see in the font you want to change, and in the browser go to View->Source. You will notice that there is not any font information on the page. The font you are seeing is the browser's default font, it doesn't have anything at all to do with ASP, or PHP, or Coldfusion, or Java Server Pages, or however you want to send the content to the browser. If you want the content you send to the browser to be formatted a specific way, then you need to use HTML or CSS. Formatting text, and content in general, is specifically what HTML and CSS are there for.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...