p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   Viewing ASP pages (http://p2p.wrox.com/showthread.php?t=3545)

bnorg September 5th, 2003 07:52 PM

Viewing ASP pages
 
I have an alias set up for an application folder in IIS 5.0. My default page displays when I use the alias in the URL as the Beg_ASP book explains. But that page is all HTML. When I try to link to the ASP pages (ie. <% %> in the code) it says that the page can't be displayed (I have to hit CONNECT because it thinks I want to access the Internet). Read and Script Execution in the properties for the application are checked. But the only difference between working and not working seems to be whether ASP code is present or not. The IIS service is running for all attempts. Are there any other parameters I have to turn on to make it work? Thanks for your feedback.

melvik September 6th, 2003 12:30 AM

check http://localhost to see if ur IIS & asp pages work or not?!
let me know?!

Always:),
Hovik Melkomian.

bnorg September 6th, 2003 10:45 AM

http://localhost brings up localstart.asp. I reinstalled IIS 5.0 to make sure. However, it still can't display pages with <% %>. When I go to one of the links on the default page there is a circle with a line across it which seems to say that you can't use it. I don't know causes that to happen. Perhaps the Href of the link should include the server name as well as the alias and page?

melvik September 6th, 2003 11:29 PM

if ur localhost is working im sure ur other ASP pages should be work as well. did u make a virtual directory?!?! I guess u made a folder in ur localhost & its not virtual directory. well u can make it now, go to IIS & open properties of the folder so there is a CREATE button just click it!

let me know the result.

Always:),
Hovik Melkomian.

planoie September 8th, 2003 08:23 AM

Quote:

quote:Originally posted by bnorg...I reinstalled IIS 5.0 to make sure...
If you reinstalled IIS and have not since also reinstalled the .Net framework, ASPX files probably won't work. Regular ASP files should, but not ASP.Net. You need to install the framework after you install IIS otherwise IIS doesn't know how to deal with ASPX files.

Peter

bnorg September 8th, 2003 06:17 PM

This is an ASP 3.0 application. It was designed after the main sample application in Wrox's Beginning ASP 3.0 book. I even put the text version on my personal page at my ISP to be able to show a few other people what it looked like. So you could see the pages at www.icehouse.net/sbnorg/compASP.htm. The default.asp and register.asp pages work on my W2K Pro OS but the others such as Login.asp do not come up. I deleted the alias for the application and then reinstalled it thinking that something was wrong there but it didn't help. I can't think of anything else to try.

melvik September 8th, 2003 11:17 PM

I've worked on ASP 3.0 for a short time & with JavaScript! so I cant help u for ur VB-Script ASP pages!!!
But I get something strang in ur all pages! u comment them all by
Code:

<!-- Comment to prevent display
& no page has <HTML> & <BODY> tags. WHY?!?! I think u have HTML problem not ASP or ...
Im going to send u a sample simple ASP page & hope u'll get the point!
Code:

<%@ language="VBScript" %>
<% option explicit %>
<html>
<head>
 <title>Folder finder</title>
</head>
<body>
 <%
   Dim ObjFSO, objFile
   set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
   if NOT ObjFSO.FolderExists(Server.MapPath("/hovik")) then
            Response.Write("Sorry, Folder does not EXIST!!!")
     else
   set objFile = ObjFSO.GetFolder(Server.MapPath("/hovik"))
%>

   [u]Attributes:</u> <%= Response.Write(objFile.Attributes) %><br>
   [u]DateCreated:</u> <%= Response.Write(objFile.DateCreated) %><br>
   [u]DateLastAccessed:</u> <%= Response.Write(objFile.DateLastAccessed) %><br>
   [u]Drive:</u> <%= Response.Write(objFile.Drive) %><br>
   [u]IsRootFolder:</u> <%= Response.Write(objFile.IsRootFolder) %><br>
   [u]Name:</u> <%= Response.Write(objFile.Name) %><br>
   [u]Path:</u> <%= Response.Write(objFile.Path) %><br>
   [u]ShortPath:</u> <%= Response.Write(objFile.ShortPath) %><br>
   [u]Size:</u><%= Response.Write(objFile.Size) %><br>
   [u]Type:</u> <%= Response.Write(objFile.Type) %><br>
<%
    end if
   set ObjFSO = nothing
   set objFile = nothing
 %>
</body>
</html>

Always:),
Hovik Melkomian.

bnorg September 9th, 2003 11:14 AM

Thanks for taking time to help. I removed IIS and reinstalled since once I had .NET installed and thought different code was interfering. Then I installed Service Pack 3. Upon rerunning the application I began getting VBScript errors that I hadn't received before. A common error was putting the comments at the end of the line instead at the beginning of a line. Now the pages are working like they should. If I hadn't reinstalled and started getting additional information I would have still been assuming the code was okay. But with programming you can't assume that and must change your glasses to look at it again in a different way to find your mistakes.

kevi3032 September 12th, 2003 03:16 PM


How does one troubleshoot this if http://localhost/ returns a 'cannot be displayed' error?

-K

Quote:

quote:Originally posted by melvik
 check http://localhost to see if ur IIS & asp pages work or not?!
let me know?!

Always:),
Hovik Melkomian.

planoie September 12th, 2003 04:31 PM

If you don't have any functioning pages in your iis root that are the default documents (root properties -> documents tab) you'll likely get this error.

I often just set my development machine up so that I can browse the directory listing and remove all but one bogus default documents in the documents list. Make it something like junk.html. You have to have one in there, just make it one you are not likely to use. Then you'll get a directory listing of your root website files and folders. Then you can at least confirm that IIS is functioning.

Peter


All times are GMT -4. The time now is 08:23 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.