0
votes

I'm attempting to do something odd here. So currently I have an asp website which will be run inside an MVC 4 application.

I've got the website inside the root of the MVC project folder, I've set my route.config file to point to default.asp in the root. Everything appears to be working correctly on that end. I have 2 errors occuring when I run the application on my local machine.

First error:

Server Error in '/RESTART' Application.________________________________________
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30451: 'mysite' is not declared. It may be inaccessible due to its protection level.

Source Error:


Line 1:  <%
Line 2:  mysite=Trim(request.servervariables("url"))
Line 3:  mysite=LCase(mysite)
Line 4:  %>

Source File: C:\Workspace\VS2010\MVC_RESTART\RESTART\RESTART\topbar.asp    Line: 2 
Show Detailed Compiler Output:

Show Complete Compilation Source:
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237

So what I can gather from this error message is that the compiler doesn't like my classic asp code. Can anyone let me know where I'm going wrong.

Second Error:

Error in '/RESTART' Application.________________________________________
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not find a part of the path 'C:\Workspace\VS2010\MVC_RESTART\RESTART\RESTART\docman\doccount.asp'.

Source Error: 

Line 1:  <!--#include file="./docman/doccount.asp"-->
Line 2:  <HTML>
Line 3:  <HEAD>

Source File:/RESTART/navbar.asp   Line: 1 
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237

With this error I gather that the application doesn't understand the way that classic asp handles paths.

Does anyone know how to resolve this?

2
Does that path C:\Workspace\VS2010\MVC_RESTART\RESTART\RESTART\docman\doccount.asp exist? That appears to be the route of the problem. Why though are you trying to compile Classic ASP in a ASP.Net MVC application in the first place?user692942
I can confirm that that path exists. I'm currently trying to add a new piece of functionality to the classic ASP website in MVC 4, my line manager feels this is the best approach.Connor McGill
What server are you using on your local machine? If it's the built in one which comes with VS then it doesn't support Classic ASP, you need IIS or IIS Express. Otherwise I refer you to my answer to your earlier question. stackoverflow.com/questions/28902819/… . Standalone Classic ASP pages can exist in a .net MVC site but the .net pages can't use the classic asp code and vice versaJohn
Not sure this will even work, Classic ASP is a scripting language it doesn't get compiled it is evaluated at runtime. I'm still unclear as to how you expect this to work.user692942

2 Answers

0
votes

OK I've got the classic ASP website running from inside an MVC 4 application. I realised that the IIS setting for parent paths is set to False by default, by enabling this on my local machine I can access the site via IIS, I will ask my server admin about the possibility of getting this enabled is. Thanks for all the help.

-1
votes
<%
dim mysite
mysite=Trim(request.servervariables("url"))
mysite=LCase(mysite)
%>

Try that just in case you need to declare it first. For the second bit, open up notepad, click open, and dump "C:\Workspace\VS2010\MVC_RESTART\RESTART\RESTART\docman\doccount.asp" into the file name bit, and see if it actually opens the file