ASP.net 2.0 Programming Tips two

Source: Internet
Author: User
Asp.net| Programming | skills

 1. Using app_offline.htm

In asp.net 2.0, if you want to copy the site, site maintenance, deployment, and make a lot of changes, it is possible to stop your Web application, and in a friendly way to prompt to the user, such as "This site is being updated" and so on, in ASP.net 2.0, You can create a static HTM page file called app_offline.htm, which changes to what you want to display temporarily, and places it in your application's root directory. In this way, any external request will be immediately transferred to the page. This time, your site can still be accessed, but your application cannot be accessed. Oh, in that case, you can avoid a lot of updates to the site is the trouble.

Of course, another method can also make your site offline in the ASP. NET Configuration Management tool under the Vs.net 2005 website menu.

Note that the size of this app_offline.htm page is larger than 512 bytes, which, in the words of ASP.net's father Scott, is "
Make sure the app_offline.htm file was large enough (bytes) to disable the IE "friendly HTTP Errors" feature

  2, the use of MaintainScrollPositionOnPostBack properties

Considering a very long page, if each postback, that IE scroll bar may return to the first place (top), and will not retain its original position, so that users will be more trouble, but also the scroll bar to the original place, in ASP.net 2.0, You can set the MaintainScrollPositionOnPostBack property to True, that is,

<%@ Page language= "VB" autoeventwireup= "false" maintainscrollpositiononpostback= "true" codefile= " MaintainScrollPosition.aspx.vb "inherits=" Maintainscrollposition "%>



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.