Asp.net usage skills)

Source: Internet
Author: User
Address: http://scottwater.com/blog/archive/quick-tips-for-asp-net-part-one/

1. Do not use the autopostback attribute on the dropdownlist control to simply
Use client code to complete functions <Asp: dropdownlist runat = "server" id = "dropdown" onchange = "If (this. selectedindex> 0)
{Window. Location = Window. Location. pathname + '? T = '+ this [This. selectedindex]. value;} "/>

2. Never use the ASP. NET label control.
The label will append additional code that is not conducive to the style. Use literal instead.

3. Use the ASP. NET repeater instead of datalist, DataGrid, and dataview controls

4. Understand how to upgrade tively use caching
The memory is very precious. Do not over-use the cache.

5. always set a memory threshold for your apppool.
Set the memory size for the application pool.

6. Use appoffline.htm for updates
Appoffline.htm is used as a temporary page in the logging program.

7. Always check page. isvalid in your button's eventhandler.
All inputs are harmful.

8. To create fully qualified URLs, use the new virtualpath class.
Use virtualpathutility to create a qualified URL String relativepath = "~ /Somefolder/test/123. aspx"
Uri newuri = new uri (request. url, virtualpathutility. toabsolute (relativepath ));

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.