Step 1
First of all the steps I followed was to create a simple web called eventlog. I also created the application root so the global.asax file would fire. Here is how to setup an application root:
1.Open Internet Service Manager MMC (Start button, Control Panel, Administrative Tools, Internet Service Manager)
2.Located on the left side of the MMC, locate the Default Web and click the + button to expand the list of webs.
3.Right-click on the web your going to make an application root and choose properties.
4.Click the Create button.
5.After your done, the folder picture will appear like a box that is open. The application root is now created.
Step 2
I opened the global web.config file and turned on custom errors. Path to this is c:\winnt\microsoft.net\framework\.. There are 3 choices available currently On, Off and RemoteOnly. From attending the conference, the recommended was RemoteOnly. This means anyone not on the console of the machine will see a friendly error and not the real thing. For this example I chose On. You also could leave the global web.config file custom errors turned off and configure at application level's web.config Either way works just fine. web.config -- this file is placed in the root of the \eventlog application root.
Step 3 The next few items are just to create sample pages to make the application complete. I created a web.config, global.asax, Default.aspx page, and three sample error pages. 404page.aspx, 403page.aspx and customerrorpage.aspx page. Here are those pages code for all pages.
Global.asax Page - This uses the Application_OnError event to capture stuff if an error happens
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Diagnostics" %>
Default.aspx page
<% @Language="VB" %>
No comments:
Post a Comment