Jump to content

[qtn]I can't display asp in web browser


foukin2

Recommended Posts

I wrote a asp page and I wanted to test it. However, the browser displayed a blank page only.

Do this:Go to your ASP page, right click and view source. If you can see the sourcecode that you typed, that means the server where your ASP page is sitting doesn't support ASP. The server is just processing the page as regular HTML, not as ASP. The reason why you get a blank page when it processes as HTML is because greaterthan / lessthan signs have a special meaning in HTML, and when you type "<% ... %>" the browser thinks you're trying to write an HTML tag that it can't understand, so it just doesn't format the tag at all (hence you get a blank page).If you're writing the page at home, then you need to have IIS or PWS installed on your computer (note: WinXP Home edition doesn't have IIS or PWS). Otherwise, you can just use a free webhost that supports ASP and test your scripts there, I recommend using Brinkster to get started.Even if you have IIS installed already, I recommend uploading your page to Brinkster and seeing if it works there. You might be able to tell if you have a problem on your home IIS depending on whether or not you get a blank page on Brinkster.If you get a blank page on Brinkster, then the problem with your ASP page is really simple: you're not writing text to the browser. For instance, there is a difference between this code:
<%Dim I, JFor I = 1 to 10     J = J * INext%>

And this code:

<%Dim I, JFor I = 1 to 10    J = J * I    response.write J & "<br>"Next%>

The first block will just process the ASP but it won't output text, so you get a blank page. The second block outputs text.Make sure that your ASP script you're testing actually outputs something to the browser.

Link to comment
Share on other sites

Go to your ASP page, right click and view source. If you can see the sourcecode that you typed, that means the server where your ASP page is sitting doesn't support ASP. The server is just processing the page as regular HTML, not as ASP. The reason why you get a blank page when it processes as HTML is because greaterthan / lessthan signs have a special meaning in HTML, and when you type "<% ... %>" the browser thinks you're trying to write an HTML tag that it can't understand, so it just doesn't format the tag at all (hence you get a blank page).
I can't see my source code. How come? How to solve it?
Link to comment
Share on other sites

I can't see my source code. How come? How to solve it?

Its a good thing that you can't see your sourcecode (you wouldn't want users to be able to right-click on your .asp page and steal all your source code), because that means you've got your IIS set up correctly. So, most likely the problem doesn't have anything to do with your IIS or your code, but its just that you aren't writing any text to the screen.However, its easier to diagnose problems with code when we can actually read it, so can you post the ASP script that you're trying to test?
Link to comment
Share on other sites

Its a good thing that you can't see your sourcecode (you wouldn't want users to be able to right-click on your .asp page and steal all your source code), because that means you've got your IIS set up correctly. So, most likely the problem doesn't have anything to do with your IIS or your code, but its just that you aren't writing any text to the screen.However, its easier to diagnose problems with code when we can actually read it, so can you post the ASP script that you're trying to test?

<%@ Language = "VBScript" %><% Option Explicit %><html><body><% Response.Write("Test")%></body></html>
Link to comment
Share on other sites

Guest timpremereur
<%@ Language = "VBScript" %><% Option Explicit %><html><body><% Response.Write("Test")%></body></html>

Hi,I had the same problem. The ASP command wasn't interpreted, though IIS is installed on my pc. As recommended above, I registered on Brinkster and uploaded the file to test it from there, and it worked. So yes, the cause is certainly that my pc processes the file as HTML, not as ASP.My question: how to make my pc process the file as ASP?
Link to comment
Share on other sites

Keep in mind IIS by default does not read the homepage if it is index.asp.By default its not set to.To set it to read index.asp as the first page over lets say index.htmstart > control panel > admin tools > internet information services (iis)find the folder containing the index.asp > right click > properties > Documents (Tab) > Add "index.asp"you could also remove the others there if you dont want lets say a index.htm to load even if its present.

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...