Some of the small knowledge points of ASP.

Source: Internet
Author: User

Dataformatstring= "{0: format string}"

We know that {0} in DataFormatString
Represents the data itself, and the format string after the colon represents the format that you want the data to appear in, and you can specify the number of digits that the decimal is to display after the specified format symbol. For example, the original data is
"1.56", the output is "1.5" if the format is set to {0:N1}. Its commonly used numeric format is shown in the following table: format string input result "{0:c}" 12345.6789 $12,345.68 "{0:c}" -12345.6789 ($12,345.68) "{0:d}" 12345 12345 "{0:d8}" 12345 00012345 "{0:e}" 12345.6789 1234568E+004 "{0:e10}" 12345.6789 1.2345678900E+004 "{0:f}" 12345.6789 12345.68 "{0:f0}" 12345.6789 12346 "{0:g}" 12345.6789 12345.6789 "{0:g7}" 123456789 1.234568E8 "{0:n}" 12345.6789 12,345.68 "{0:n4}" 123456789 123,456,789.0000 "total: {0:c}" 12345.6789 total: $12345.68 its commonly used date format is shown in the following table: Format description output format D Thin date format mm/dd/yyyyd Detail date format dddd, MMMM DD, YYYYF full format (long date + short time) dddd, MMMM dd, yyyy hh:mmf full datetime format (long date + long time) dddd, MMMM DD , yyyy HH:MM:SSG General format (short date + short time) mm/dd/yyyy HH:MMG General format (short date + long time) mm/dd/yyyy hh:mm:ssm,m Month Day lattice MMMM DDS Moderate DateTime format YYYY-MM-DD HH:MM:SST compact time format HH:MMT verbose time format HH:mm:ss know that there are other uses, such as having a datetime type data that you want to show in your own thoughts, You can call its ToString () method, and do not believe you can try the following statement:
DateTime Now=datetime.now;
Console.WriteLine (now. ToString ("G")); Console.WriteLine (now. ToString ("D")); Console.WriteLine (now. ToString ("S")); Console.WriteLine (now. ToString ("T")); Console.WriteLine (now. ToString ("F")); Finally special note: In the GridView dataformatstring invalid problem, you need to set the field's HTMLEncode property, the default is true, change it to False

There is a sortexpression inside every BoundField inside the GridView,

Sort the field, click the name of the field that defines the property, get the collation of the field, produce a sort event, modify the view state of the dataset (data source), sort the rules by that field
There are also the properties that are commonly used: SortDirection

Asp. EnableViewState properties of controls in net

Http://www.cnblogs.com/wayfarer/archive/2004/04/25/7574.aspx

Listbox1.selectedindexchanged +=new EventHandler (...);

Some of the small knowledge points of ASP.

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.