Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include statement

Status
Not open for further replies.

isthisthingon

IS-IT--Management
May 17, 2005
65
US
I have created an asp login page. all pages that are considered protected have the following line in them to disable entering the url automatically: <!--#include file="logincheck.asp"-->

I have created a new aspx page called dir_list2.aspx which works fine to display the contents of a folder of documents and allows users to download and open them. When I place the above include statement in the aspx page, the following error occurs when users click the link to access the page from the protected.asp page after logging in:

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>


Thanks for all help. I am a newbie and I am amazed I got this far. I don't know if this has something to do with this page being an aspx page and the others being asp pages or not. Thanks!!!
 
Isthisthingon: I'm not sure what is causing the specific error you are talking about but the following:
Code:
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
..should allow you to see the break line on the server using a remote machine. You might add Debug="true" to the page directive at the top of the page (though not always necc).

At least Isthisthingon when the above configuration is used on one of my pages I see the debugger on the server. Post back and let us know if you get any further in your debuggine.

Also, the statement <!--#include file="logincheck.asp"--> might itself be incompatible under the current conditions and may have to be modified to work with asp.net. I'm sure someone else will drop by either later tonite or first thing in the morning to help you along.
 
Include files in .NET can cause problems and usually are incompatiable. What I do, is I convert the include files to a usercontrol (which should work in your case). Other files I convert to class files.

Jim
 
Thanks for the advice. I am a newbie, how would I convert it to a usercontrol? Thanks!!!
 
Just create a new user control and add the same functionality to it. You then just have to drop this user control onto each page that needs it.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
and by create a new user control, you mean? How do I do that? please pardon my newbie status.
 
Right click your project in the solution explorer. Choose add then web user control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top