A toolkit custom HTTP 404 error is recommended.

Source: Internet
Author: User

A convenient tool, Microsoft toolkit-web error toolkit, helps you design and implement custom error pages.

The webpage error toolkit is an ASP. NET application that is clicked to IIS. Modify other files on An ASPX page to include the Toolkit and deploy IIS on your custom page. The error page displays search results so that visitors can easily find errors with the correct information.

By default, the page uses the Microsoft Live Search Engine to generate search results (although you can use another search engine if you like ). If the URL or search string is incorrectly typed, you can also provide alternative spelling suggestions on the page. Microsoft uses this Web Toolkit on its own site to help visitors.

Page error toolkit requirements include:

  • Windows 2000, Windows Vista Windows XP, Windows Server 2003, or Windows Server 2008
  • IIS 5.0 or later
  • ASP. NET 2.0 or later
  • Visual Studio 2005 or later

Download and install

You can download the webpage error toolkit from the live service. We recommend that you install the downloaded file webpageerrortoolkitsetup. MSI to the root directory of the website. However, it is recommended to install to the default directory c files \ Microsoft \ Web page error Toolkit), and then copy the necessary files and directories to the root directory of the server. This allows you to control which files are stored in the root directory. In the future, the new folder will display a webpage error toolkit and two shortcut program menus: User Guide) and webpage error toolkit files.

The toolkit files include:

Web. config. merge this is the setting file that contains the required settings for your web. config file. For ASP. NET websites, the Web. config file contains some core settings of different parts.

Errorpage. aspx This is a custom error page that will be replaced in the generic 404 error page.

Errorpage. aspx. CS errorpage. aspx hides pages in C # code.

Errorstyle.css is on the error page of the style sheet.

Userguide.docx Microsoft Office Word 2007 format document.

Readme. rtf this is a simple document, which describes the need to be executed with the Web. config. Merge file.

Mspl license. rtf documentation and software authorization information.

You will also find three subdirectories in the installation directory: app _ code, bin, and Web reference.

Set web server

First, you must copy the required files to the root directory of your Web server if you choose not to install them. Errorpage. aspx, errorpage. aspx. CS, errorstyle.css, and Web. config. Merge should be copied to the root. In addition, three subdirectories are copied: app _ code, bin, and Web reference. Note the following when copying the three subdirectories that may already exist in the root directory of the Web server. However, you should be safe because the files in these directories are specific to the toolkit and do not conflict with any existing files.

Set in the web. config file

Next, you must set it in the web. config file. If no web. config file exists in the root directory of your Web server, Web. config. Merge renames web. config and uses the application as the default. However, if your web site runs ASP. NET, the Web. config file should be stored in the root directory. In this case, you need to merge the Web. config. Merge file to your existing web. config file.

Before executing this operation, you must change the settings. In a text editor or Visual Studio, open the Web. config. Merge file. Search for and modify parameters in the following sections:

Errorpage. appid if you want to use live search for your search engine, you must first obtain the ID on the search.live.com website. Then, enter this ID in this section.

Errorpage. cultureinfo you can enter the regional/regional settings to perform the search. The default value is en-us.

Errorpage. domain in this section, you enter a domain to tell the toolkit to retrieve the name of the location where the search result is to be displayed on the error page.

Errorpage. websearchresultsnumber indicates the number of search results listed on the maximum error page. The default value is 10, and the maximum value is 50.

Errorpage. Invalid mspellcheck if you enter the value true here, do you want to display spelling suggestions, such error page or search string when you type the URL.

Errorpage. spellingmessage in this section, you type the syntax of the question that you want to display spelling errors. Default text string: you are looking for {suggestion} and?

Errorpage. searchtitle this is the title of the page if the correct content is not provided in subsequent search queries. Otherwise, your website visitor will keep receiving this phrase: Sorry, the requested page cannot be found.

Errorpage. privacyurl, errorpage. sitemap. URL, and errorpage. copyrighturl can add links to these other webpages, which are displayed in the footer of the error page.

After the Web. config. Merge file has been modified, you must merge the settings into the existing web. config file. The Web. config. Merge file contains two parts: etettings and System. Web. The setting in the appsettings section is the toolkit, so you can copy and paste the strings directly to the same section in the web. config file. The system. web section contains the customerrors of a string. If the customerrors string already exists in the web. config file, comment it and replace the string from the Web. config. Merge file. Remember to back up the existing web. config file before making any changes.

Customize the errorpage File

The errorpage. aspx file may be modified in the next step. This file is fully configured, so you do not need to execute the following. You can change some error response pages, such as "sorry, cannot find the requested page" and "view the text string that is close to the result of your request" for you. Finally, you can modify the errorstyle.css style sheet by adjusting the color, Font, pound value, and the errorpage. aspx file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.