The seven tricks of the asp.net application that don't take the usual road design
Source: Internet
Author: User
The seven tricks of the asp.net application that don't take the usual road design
With Microsoft. Net of the popular, ASP. NET is increasingly accepted by developers. As ASP.net developers, we not only need to master its basic principles, but also more practice, from the practice of acquiring real development skills. In our actual development, often the basic principle can not meet the development needs, we have more to accumulate some development skills, this article to introduce some practical skills, hope for the development of everyone to benefit.
1. The usage of the ~
In general, we are using./. /Such a relative path to identify and plan our resources (such as pictures, resource files), but in this way when we deploy the application, there may be errors, The problem arises if you include a picture in a control of. ascx, and the control is referenced separately by us at different levels of the two-directory aspx file.
~/image/about.bmp is a great way to start with a Web application's root directory, which makes it more flexible and convenient than you use./image/about.bmp. The downside is that this approach is dynamically parsed at ASP.net runtime, so you may not be able to preview it in IDE design mode.
2. After refreshing and submitting the page, save the location of your page scroll bar
Often there are cases where we need users to submit a form, but are there more than 500+ in the form? control or text box to fill in, that is, users need to pull the IE scroll bar to fill out, then if the user is visible ie range of 2/3, select a combo box value, Unfortunately, the combo box is server-side, then it means that the page will be submitted once, and when the user again see the refreshed page, the page is determined in 3/1 of the place is displayed at the beginning of the page, the user only drag the mouse, and then just fill in the remaining 250 controls, unfortunately, 370 controls do you want him to choose?
Use the following method to quickly identify and remember where you were before submitting.
The old Dog learns New tricks also has a similar example maintain Scroll in the any Page Element, but he uses the Web Position which means you need to use an. htc file
Private Sub retainscrollposition ()
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.