What I did when I was doing Asp.net or something I learned (I will update it frequently)

Source: Internet
Author: User

1. In LINQ ,. where (predicate ). orderbydescending (B => B. ID ). orderbydescending (B => B. istop ). tolist () The orderby () here must be careful, there is a sequential order, the orderby () written later will be converted into an SQL statement. If you do not pay attention to it, the order will be reversed, leading to the sorting bug, which can be detected by the SQL event probe.

The SQL statement generated by the preceding statement is "Where XXXXXXXX order by Istop DESC, Id DESC ".

 

2. Do not trust the membership profile too much. Sometimes it cannot retrieve objects, which is very strange. We recommend that you configure strong identity information instead of those fields in Web. config. I can't explain it so far. I can only say it is a RP problem.

 

3. During enumeration encoding, remember to leave the extended space, and put the special form in front. For example

Code
/// <Summary>
/// Unit type
/// </Summary>
Public Enum branchtype
{
/// <Summary>
/// Others
/// </Summary>
Other = 0,
/// <Summary>
/// School
/// </Summary>
School = 1,
/// <Summary>
/// Authority
/// </Summary>
Government = 2,
/// <Summary>
/// Enterprises and Institutions
/// </Summary>
Corporation = 3,
}

This other is placed in the 0-bit position. In fact, the goal is also very simple. If the customer says that they want to add one, it will be ugly after the other.

 

4. Error about "error: ASP. NET Ajax client framework not loaded" during ASP. net3.5 Ajax deployment

The reason is that some virtual hosts do not parse the. axd file by default, causing file generation failures such as script resources, similar to the following:

 <script src="/WebResource.axd?d=65Ia2ddeYx8IU6vULCb8TQ2&amp;t=633435259615117500" type="text/javascript"></script>
Solution: Add resolution to the. axd file in IIS. Be sure to cancel "check whether the file exists ".

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.