ASP Include file not found - iis-7

I am a Systems Administrator (not for a company just work for a 3rd party company), and having an issue with an error that i receive on the server side when browsing his website from the server.
Error
Active Server Pages error 'ASP 0126'
Include file not found
/login.asp, line 3
The include file '/includes/connect.asp' was not found
I enabled parent paths in IIS 7 but it stills errors out. I am not a ASP guy at all, but all things in IIS looks ok. Is it his code? Anything he could try? Had a feeling doing research that it has something to do with his paths to his file?
Thanks guys

You may receive an "ASP 0126" error message when you try to view an ASP Web page that is hosted in IIS 6
Please check this post from MSDN. Resolutions are there.
ASP 0126
Just to bring the answer to Stack Overflow. Below are the workarounds.
Method 1: Use the #include virtual statement together with an absolute file path
To work around this issue, use the #include virtual statement together with an absolute file path in the Test.asp Web page. Consider the following code examples:
The following line of code does not work.
<!-- #include virtual ="../Date.asp" -->
The follow line of code works.
<!-- #include virtual ="Samples/Includes/Date.asp" -->
Method 2: Use the #include file statement together with a relative file path
To work around this issue, use the #include file statement together with a relative file path in the Test.asp Web page. Consider the following code samples:
The following line of code does not work.
<!-- #include virtual ="../Date.asp" -->
The following line of code does work.
<!-- #include file ="..\Date.asp -->
Note By default, parent paths are disabled in IIS 6. To enable parent paths, you must manually set the AspEnableParentPaths property in the metabase to TRUE.

Related

Rich text editor with standalone apps under Sitecore web root

I've been trying to configure a standalone ASP.Net application beneath a Sitecore web root (more or less as outlined here: http://sitecoreblog.alexshyba.com/2009/05/standalone-apps-under-sitecore-web-root.html). It's almost successful in that the virtual directory runs, but in the /sitecore folder, the rich text editor no longer works. Here is the error it throws:
'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager.
It works fine when I revert back to the original configuration.
Does anyone know how to properly configure this?
More info (1):
So, in the sitecore web.config, at the root, I added:
location path="." inheritInChildApplications="false" above the sitecore, system.webserver, and system.web nodes. The non-sitecore app I was attempting to run works great when I do this, but it somehow creates the Telerik.Web.UI.WebResource.axd I mention above, in the /sitecore folder, mostly when using the rich text box.
More info (2): This happens when I make these changes to the web.config in the sitecore root. While attempting to fix the problem, I did make a few changes to the web.config files in the /sitecore folder (including deleting them). but it made no difference. I've since restored the /sitecore folder to it's original configuration.
The standalone app is running as a separate app, immediately off the root, so: http://mysitecoresite/mystandaloneapp.
I had the same problem. After much searching, this fixed it for me (using v7.2 rev 140228): http://docs.telerik.com/devtools/aspnet-ajax/controls/scriptmanager/troubleshooting/overview#telerikwebuiwebresourceaxd-is-missing-in-webconfig-radscriptmanager-requires-a-httphandler-registration-in-webconfig
You have to set the EnableHandlerDetection property where it is declared on the Sitecore .aspx pages. I found it on EditorWindow.aspx and EditorPage.aspx.
<telerik:RadScriptManager ID="RadScriptManager" runat="server" EnableHandlerDetection="false"></telerik:RadScriptManager>

using Classic ASP INCLUDE VIRTUAL in ASP.NET page

I maintain an Classic ASP intranet site. I've developed a new page in ASP.NET that has a link to it from the old site. I would like to use the INCLUDE from the intranet which puts a header with menus on each page. I get a compile error when I run the new page in the debugger. The INCLUDE file contains nested INCLUDE files. The error says it can't find the nested includes. It's looking for them in the C:\xxxxxx when the actual physical path is on the d:\ drive.
Apparently it's resolving the INCLUDE VIRTUAL for the top level include, because it's looking for the nested includes.
Why does it resolve the first include, finding it on the D:\ drive, but is looking for the nested includes on the C:\ drive?
here's the code for the top level include
< !--#include virtual="/includes/page2header.asp"-->
here's the code for the nested includes
< !-- #INCLUDE virtual="/inc/menustyles.txt" -->
< !-- #INCLUDE virtual="/inc/Config.asp" -->
The site is running on IIS 7.5.
The site is located on the server on the default website in a virtual directory in the path
D:\inetpub\wwwroot
The compiler is looking for the nested includes in this path with this error,
Could not find a part of the path 'C:\inetpub\wwwroot\inc\menustyles.txt'
Include files don't work in the same way in ASP.NET as they do in classic ASP. When you use the Include directive, it results in the file content being rendered as plain text in the ASP.NET page. You will have to take an ASP.NET route to solve your problem. Typically, User Controls are used to render snippets of reusable HTML.
See my article on this topic for more information: http://www.mikesdotnetting.com/Article/144/Classic-ASP-Include-Files-in-ASP.NET
The problem I was having here is I was running the debugger on my development machine, and it's virtual directory IS on the C:\ drive for this site, and the first level virtual file did exist in the path where the compiler was looking for it, and the nested files did not exist. The problem was solved when I copied the nested files into place on the development machine.
However, that raised a new problem. The nested files contain server side script, Classic ASP VBScript, and it just won't run in my ASP.NET page. This problem brings this effort to a dead end, unless someone can recommend how to solve this new problem.
Thanks, Bren

Virtual include not working

I have recently taken over a website written in Classic ASP which i had no previous experience with.
In the root of the site the default.asp has an include:
#include virtual="/inc/common.asp"
However when hosted on the web server or locally (IIS) it returns with an error which says the include file 'common.asp' could not be found. The inc folder exists in the same directory as the default.asp and the common.asp is in the inc folder.
Any help would be appreciated!
You say that the inc folder is in the same folder as default.asp - however you don't say if this folder is root. #include virtual takes a path from root, so ensure that you have the full path in there.
There's a quick explanation of #include syntax here: http://www.w3schools.com/asp/asp_incfiles.asp
You cannot start an include link in Classic ASP with a slash (/). So your include needs to be like:
#include file="inc/common.asp"
or
#include file="../inc/common.asp"
or
include file="../../inc/common.asp"
Notice that I used "file" instead of "virtual"?
<!--#include file="inc/common.asp" -->
Also, unless your include is within the same folder, you will need to enable "parent paths" in IIS admin.

File not found error in Asp.net 4.0

On Local host,my solution works fine but on server when i deploy ,it gives that file not found error. and the error message is something like this.http://localhost:27375/favicon.ico
I don't have any such file in my application.I tried to create on in the root folder but no luck.any help is highly appreciated
Your favicon.ico file should be in your root directory for the web site.
It looks like your application is still trying to connect to the localhost in order to display the favicon. Are you hard-coding your URL to the favicon with a http://localhost:27275/favico.ico address?
To build on what Internet Engineer said, using ASP.NET, you can use a relative path prefaced with ~ or /. So, you can use ~/favico.ico or /favico.ico in order to reference your icon file.
First check in web server if you can see the file directly in the browser:
http://productionwebsite/favico.ico
If the file is there, now you need to check that the code is using relative paths. Most likely this is coded using absolute paths.

Why isn't #include working on .asp page in IIS7.5?

I saw a similar question to this, but mine is slightly different:
I'm get intermittent results with #include files working on an IIS 7.5 server (R2008 V2). My includes are only working if they are in the same folder as the current .asp page, or in a subfolder of the current page. This is inconvenient, as I'd like to keep them all in a /lib subfolder, off of the main page.
My configuration: I have a folder named DCN, sitting right below the wwwroot folder. There are several files in a /lib folder within the DCN folder, so the absolute path is c:\inetpub\wwwroot\dcn\lib\my_include_file.asp. If I open an ASP page in the DCN folder, I can pull include files from the /lib subfolder. However, if I open an ASP page from the DCN/trouble folder (such as "DCN\Trouble\Search.asp"), and the search.asp page has a line that says:
<!--#include file="../lib/my_include_file.asp"-->
the include fails, and I get a 500 error.
I've also tried:
<!--#include file="/lib/my_include_file.asp"-->
with the same results. Same with:
<!--#include file="/DCN/lib/my_include_file.asp"-->
I changed the slashes to backslashes, with the same results. I even went so far as to try:
<!--#include file="c:\inetpub\wwwroot\dcn\lib\my_include_file.asp"-->
(out of sheer desparation), but am still getting the same results.
If I create a subfolder in the dcn\trouble folder, I can include files from it, but obviously, this is not ideal.
Any suggestions would be greatly appreciated. I can't help but think this is something trivial. Thanks in advance!
Yots is correct, it sounds like parent paths are turned off. If you can't get these turned on the use virtual paths instead:
Based on your question where you state that the include files are in /DCN/lib then do the following:
<!-- #include virtual="/DCN/lib/my_include_file.asp -->
When using virtual paths you must specify the full virtual path to the file i.e. from the root of the site. This isn't ideal if you're building your application in a subfolder on your development machine where you're using XP and then deploying into the root of a production machine. That said IIS7 on Vista or Windows 7 permits the creation of multiple sites now **.
When using a path type of File="...", filename must be on a relative path to the folder containing the #include. For example:
The directive <!-- #include file="my_include.asp" --> will include my_include.asp from the same folder.
The directive <!-- #include file="lib/my_include.asp" --> will include my_include.asp from the folder lib below the current folder where the script is running.
The directive <!-- #include file="../my_include.asp" --> will include my_include.asp from the folder lib above the current folder (the parent folder) where the script is running.
The directive <!-- #include file="../lib/my_include.asp" --> will include my_include.asp from the folder lib that is a child of the parent folder (or the current folder's sibling).
The last two examples won't work if parent paths are not enabled.
** I am aware there are hacks to enable multiple IIS sites in XP's IIS5.1.
I think your problem is that parent paths are disabled by default in IIS.
You have two options:
Using Virtual Paths
Enabling ASP Parent Paths on IIS
For details read this article from the IIS Website
http://learn.iis.net/page.aspx/566/classic-asp-parent-paths-are-disabled-by-default/
What about a #include virtual? if it reads:
#include virtual="\mysite\include\file.inc
it should find the file.inc in the include folder under mysite? I have enabled and disabled parent paths and tried about a million things. I still receive an asp 0126 error for the file not found. I can swtich it to include file and then it finds it, but then the file.inc has a bunch of other includes and it then cant find them no matter how i change it to include file or virtual. It works in IIS 6, but not IIS 7 that i am moving this site to. It is a classic asp page with mostly everything done in include files
I have mysite in the Default Web site\dept_Sites\mysite location.

Resources