17. Digital Format
【The result of <%#("price")%> is 500.0000, how to format it to 500.00?】
<%#("price","{0:¥#,##0.00}")%>
int i=123456;
string s=("###,###.00");
18. Date formatting
【In aspx page: <%# (,"Company_Ureg_Date")%>
Shown as: 2004-8-11 19:44:28
I just want: 2004-8-11 】
<%# (,"Company_Ureg_Date","{0:yyyy-M-d}")%>
How should it be changed?
【Format date】
Take it out, usually object((DateTime)objectFromDB).ToString("yyyy-MM-dd");
[Date verification expression]
A. The following correct input formats: [2004-2-29], [2004-02-29 10:29:39 pm], [2004/12/31]
^((\d{2}(([02468][048])([13579][26]))[\-\/\s]?((((0?[13578])(1[02]))[\-\/\s]?((0?[1-9])([1-2][0-9])(3[01])))(((0?[469])(11))[\-\/\s]?((0?[1-9])([1-2][0-9])(30)))(0?2[\-\/\s]?((0?[1-9])([1-2][0-9])))))(\d{2}(([02468][1235679])([13579][01345789]))[\-\/\s]?((((0?[13578])(1[02]))[\-\/\s]?((0?[1-9])([1-2][0-9])(3[01])))(((0?[469])(11))[\-\/\s]?((0?[1-9])([1-2][0-9])(30)))(0?2[\-\/\s]?((0?[1-9])(1[0-9])(2[0-8]))))))(\s(((0?[1-9])(1[0-2]))\:([0-5][0-9])((\s)(\:([0-5][0-9])\s))([AMPMampm]{2,2})))?$
B. The following correct input formats: [0001-12-31], [9999 09 30], [2002/03/03]
^\d{4}[\-\/\s]?((((0[13578])(1[02]))[\-\/\s]?(([0-2][0-9])(3[01])))(((0[469])(11))[\-\/\s]?(([0-2][0-9])(30)))(02[\-\/\s]?[0-2][0-9]))$
[Case conversion]
(string);
(string)
19. How to set global variables
middle
In the Application_Start() event
Add Application[Attribute Name] = xxx;
It's your global variable
20. How to make the connection generated by HyperLinkColumn, click Connect to open a new window?
HyperLinkColumn has a property Target, just set the value of the device to "_blank". (Target="_blank")
【ASPNETMENU】Click the menu item to pop up a new window
Add URLTarget="_blank" to the menu item of your file, such as:
<?xml version="1.0" encoding="GB2312"?>
<MenuData ImagesBaseURL="images/">
<MenuGroup>
<MenuItem Label="Insider Information" URL="" >
<MenuGroup ID="BBC">
<MenuItem Label="Announcement Information" URL="" URLTarget="_blank" LeftIcon=""/>
<MenuItem Label="Prepare an Information Brief" URL="" LeftIcon="" />
......
It is best to upgrade your aspnetmenu to version 1.2
21. Read the TextBox value of the DataGrid control
foreach(DataGrid dgi in )
{
TextBox tb = (TextBox)("yourTextBoxId");
....
}
23. In DataGrid, there are 3 template columns containing Textboxes, DG_ShuLiang (quantity) DG_DanJian (unit price) DG_JinE (amount) respectively, and the amount is required to be automatically calculated when entering the quantity and unit price, that is,: quantity * unit price = amount, and the limit is also required to be numerical when entering. How do I use client scripts to implement this function?
Previous page1234567Next pageRead the full text