Jump to content

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


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 post
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 post
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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...