GridView control Field Properties DataFormatString deep in a heap of pits

Source: Internet
Author: User

Today by the DataFormatString attribute pit one day, the development environment Test format came out in line with the expectations, and the deployment to the production environment does not work, and later compared to the environment, with multiple virtual machines deployed different environment version to do the test, finally get the following points of understanding.

① field type must be datetime type, this is not too much problem;

Formatting patterns such as ②d,d depend on the appropriate date format defined by regional and language options in the server environment, and if you want to ensure consistent formatting, you need to specify a specific format, such as {0:yyyy ' MM ' DD ' Day};

③.net version under 3.5 must mate htmlencode= "False" attribute, otherwise it doesn't work, this pit me a day ah, The development environment from 1.1 to 4.0 is full, and the production environment is 2.0, then I tested 3.0 and 3.5 environment, finally get the conclusion, 3.5 above do not have to match the HTMLEncode property, and 3.5 below to set HTMLEncode to False can be normal.

GridView control Field Properties DataFormatString deep in a heap of pits

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.