asp.net2005 笔记
2007-03-29 12:42
288 查看
<asp:TemplateField HeaderText="QQ">
<ItemTemplate>
<%# Eval("QQ")%>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="审核">
<ItemTemplate>
<asp:HyperLink ID="hl3" runat="server" NavigateUrl='<%# string.Format("~/DokerParter/AuditDetail.aspx?type=2&Code={0}", Eval("Code")) %>'>审核</asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Center"/>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="删除">
<ItemTemplate>
<asp:LinkButton Text="删除" OnClientClick="return confirm('确认要删除此项?');" ID="lbDelete" runat="server" CommandArgument='<%# Eval("Code") %>' OnClick="lbDelete_Click" ></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
string code = ((LinkButton)sender).CommandArgument;
// This code example demonstrates the String.Format() method.
using System;
class Sample
...{
enum Color ...{Yellow = 1, Blue, Green};
static DateTime thisDate = DateTime.Now;
public static void Main()
...{
// Store the output of the String.Format method in a string.
string s = "";
// Format a negative integer or floating-point number in various ways.
Console.WriteLine("Standard Numeric Format Specifiers");
s = String.Format(
"(C) Currency: . . . . . . . . {0:C} " +
"(D) Decimal:. . . . . . . . . {0:D} " +
"(E) Scientific: . . . . . . . {1:E} " +
"(F) Fixed point:. . . . . . . {1:F} " +
"(G) General:. . . . . . . . . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(N) Number: . . . . . . . . . {0:N} " +
"(P) Percent:. . . . . . . . . {1:P} " +
"(R) Round-trip: . . . . . . . {1:R} " +
"(X) Hexadecimal:. . . . . . . {0:X} ",
-123, -123.45f);
Console.WriteLine(s);
// Format the current date in various ways.
Console.WriteLine("Standard DateTime Format Specifiers");
s = String.Format(
"(d) Short date: . . . . . . . {0:d} " +
"(D) Long date:. . . . . . . . {0:D} " +
"(t) Short time: . . . . . . . {0:t} " +
"(T) Long time:. . . . . . . . {0:T} " +
"(f) Full date/short time: . . {0:f} " +
"(F) Full date/long time:. . . {0:F} " +
"(g) General date/short time:. {0:g} " +
"(G) General date/long time: . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(M) Month:. . . . . . . . . . {0:M} " +
"(R) RFC1123:. . . . . . . . . {0:R} " +
"(s) Sortable: . . . . . . . . {0:s} " +
"(u) Universal sortable: . . . {0:u} (invariant) " +
"(U) Universal sortable: . . . {0:U} " +
"(Y) Year: . . . . . . . . . . {0:Y} ",
thisDate);
Console.WriteLine(s);
// Format a Color enumeration value in various ways.
Console.WriteLine("Standard Enumeration Format Specifiers");
s = String.Format(
"(G) General:. . . . . . . . . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(F) Flags:. . . . . . . . . . {0:F} (flags or integer) " +
"(D) Decimal number: . . . . . {0:D} " +
"(X) Hexadecimal:. . . . . . . {0:X} ",
Color.Green);
Console.WriteLine(s);
}
}
以上代码的输出结果如下:
Standard Numeric Format Specifiers
(C) Currency: . . . . . . . . ¥-123.00
(D) Decimal:. . . . . . . . . -123
(E) Scientific: . . . . . . . -1.234500E+002
(F) Fixed point:. . . . . . . -123.45
(G) General:. . . . . . . . . -123
(default):. . . . . . . . -123 (default = 'G')
(N) Number: . . . . . . . . . -123.00
(P) Percent:. . . . . . . . . -12,345.00%
(R) Round-trip: . . . . . . . -123.45
(X) Hexadecimal:. . . . . . . FFFFFF85
Standard DateTime Format Specifiers
(d) Short date: . . . . . . . 2007-1-29
(D) Long date:. . . . . . . . 2007年1月29日
(t) Short time: . . . . . . . 13:57
(T) Long time:. . . . . . . . 13:57:42
(f) Full date/short time: . . 2007年1月29日 13:57
(F) Full date/long time:. . . 2007年1月29日 13:57:42
(g) General date/short time:. 2007-1-29 13:57
(G) General date/long time: . 2007-1-29 13:57:42
(default):. . . . . . . . 2007-1-29 13:57:42 (default = 'G')
(M) Month:. . . . . . . . . . 1月29日
(R) RFC1123:. . . . . . . . . Mon, 29 Jan 2007 13:57:42 GMT
(s) Sortable: . . . . . . . . 2007-01-29T13:57:42
(u) Universal sortable: . . . 2007-01-29 13:57:42Z (invariant)
(U) Universal sortable: . . . 2007年1月29日 5:57:42
(Y) Year: . . . . . . . . . . 2007年1月
Standard Enumeration Format Specifiers
(G) General:. . . . . . . . . Green
(default):. . . . . . . . Green (default = 'G')
(F) Flags:. . . . . . . . . . Green (flags or integer)
(D) Decimal number: . . . . . 3
(X) Hexadecimal:. . . . . . . 00000003
<ItemTemplate>
<%# Eval("QQ")%>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="审核">
<ItemTemplate>
<asp:HyperLink ID="hl3" runat="server" NavigateUrl='<%# string.Format("~/DokerParter/AuditDetail.aspx?type=2&Code={0}", Eval("Code")) %>'>审核</asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Center"/>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="删除">
<ItemTemplate>
<asp:LinkButton Text="删除" OnClientClick="return confirm('确认要删除此项?');" ID="lbDelete" runat="server" CommandArgument='<%# Eval("Code") %>' OnClick="lbDelete_Click" ></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
string code = ((LinkButton)sender).CommandArgument;
// This code example demonstrates the String.Format() method.
using System;
class Sample
...{
enum Color ...{Yellow = 1, Blue, Green};
static DateTime thisDate = DateTime.Now;
public static void Main()
...{
// Store the output of the String.Format method in a string.
string s = "";
// Format a negative integer or floating-point number in various ways.
Console.WriteLine("Standard Numeric Format Specifiers");
s = String.Format(
"(C) Currency: . . . . . . . . {0:C} " +
"(D) Decimal:. . . . . . . . . {0:D} " +
"(E) Scientific: . . . . . . . {1:E} " +
"(F) Fixed point:. . . . . . . {1:F} " +
"(G) General:. . . . . . . . . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(N) Number: . . . . . . . . . {0:N} " +
"(P) Percent:. . . . . . . . . {1:P} " +
"(R) Round-trip: . . . . . . . {1:R} " +
"(X) Hexadecimal:. . . . . . . {0:X} ",
-123, -123.45f);
Console.WriteLine(s);
// Format the current date in various ways.
Console.WriteLine("Standard DateTime Format Specifiers");
s = String.Format(
"(d) Short date: . . . . . . . {0:d} " +
"(D) Long date:. . . . . . . . {0:D} " +
"(t) Short time: . . . . . . . {0:t} " +
"(T) Long time:. . . . . . . . {0:T} " +
"(f) Full date/short time: . . {0:f} " +
"(F) Full date/long time:. . . {0:F} " +
"(g) General date/short time:. {0:g} " +
"(G) General date/long time: . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(M) Month:. . . . . . . . . . {0:M} " +
"(R) RFC1123:. . . . . . . . . {0:R} " +
"(s) Sortable: . . . . . . . . {0:s} " +
"(u) Universal sortable: . . . {0:u} (invariant) " +
"(U) Universal sortable: . . . {0:U} " +
"(Y) Year: . . . . . . . . . . {0:Y} ",
thisDate);
Console.WriteLine(s);
// Format a Color enumeration value in various ways.
Console.WriteLine("Standard Enumeration Format Specifiers");
s = String.Format(
"(G) General:. . . . . . . . . {0:G} " +
" (default):. . . . . . . . {0} (default = 'G') " +
"(F) Flags:. . . . . . . . . . {0:F} (flags or integer) " +
"(D) Decimal number: . . . . . {0:D} " +
"(X) Hexadecimal:. . . . . . . {0:X} ",
Color.Green);
Console.WriteLine(s);
}
}
以上代码的输出结果如下:
Standard Numeric Format Specifiers
(C) Currency: . . . . . . . . ¥-123.00
(D) Decimal:. . . . . . . . . -123
(E) Scientific: . . . . . . . -1.234500E+002
(F) Fixed point:. . . . . . . -123.45
(G) General:. . . . . . . . . -123
(default):. . . . . . . . -123 (default = 'G')
(N) Number: . . . . . . . . . -123.00
(P) Percent:. . . . . . . . . -12,345.00%
(R) Round-trip: . . . . . . . -123.45
(X) Hexadecimal:. . . . . . . FFFFFF85
Standard DateTime Format Specifiers
(d) Short date: . . . . . . . 2007-1-29
(D) Long date:. . . . . . . . 2007年1月29日
(t) Short time: . . . . . . . 13:57
(T) Long time:. . . . . . . . 13:57:42
(f) Full date/short time: . . 2007年1月29日 13:57
(F) Full date/long time:. . . 2007年1月29日 13:57:42
(g) General date/short time:. 2007-1-29 13:57
(G) General date/long time: . 2007-1-29 13:57:42
(default):. . . . . . . . 2007-1-29 13:57:42 (default = 'G')
(M) Month:. . . . . . . . . . 1月29日
(R) RFC1123:. . . . . . . . . Mon, 29 Jan 2007 13:57:42 GMT
(s) Sortable: . . . . . . . . 2007-01-29T13:57:42
(u) Universal sortable: . . . 2007-01-29 13:57:42Z (invariant)
(U) Universal sortable: . . . 2007年1月29日 5:57:42
(Y) Year: . . . . . . . . . . 2007年1月
Standard Enumeration Format Specifiers
(G) General:. . . . . . . . . Green
(default):. . . . . . . . Green (default = 'G')
(F) Flags:. . . . . . . . . . Green (flags or integer)
(D) Decimal number: . . . . . 3
(X) Hexadecimal:. . . . . . . 00000003
相关文章推荐
- ASP.NET 3.5核心编程学习笔记(13):SQL Server 2005中特有的改进
- ASP.NET Core 2 学习笔记(九)模型绑定
- ASP.NET学习笔记四 控件使用
- 新手asp.net 学习笔记一 2012.10
- ASP.NET Core 2 学习笔记(十二)REST-Like API
- ASP.NET MVC 学习笔记(MVC概念和工作模式)
- 【学习】Asp.net MVC 学习笔记之-使用MVC中的AJAX
- Asp.net mvc 2 in action 笔记-1 概述、Model
- (7)学习笔记 ) ASP.NET CORE微服务 Micro-Service ---- 利用Polly+AOP+依赖注入封装的降级框架
- ASP.NET MVC学习笔记 (2)
- Asp.net Ajax 学习笔记7 客户端访问WebService(中)
- ASP.NET MVC Web API 学习笔记---第一个Web API程序
- 黑马程序员--ASP.NET基础学习笔记
- MapXtreme 2005 For .Net 学习笔记
- 基于Asp.Net 2.0(C#)和SQL Server 2005使用DSOFramer全攻略
- ASP.NET MVC4应用程序基本结构和执行流程---ASP.NET学习笔记(1)
- Asp.Net Ajax 学习笔记10 JavaScript的原生类型以及Microsoft AJAX Library的相关扩展(下)
- Programming ASP.NET 学习笔记(要点)第3章 控件:基本概念
- 黑马程序员之 ASP.NET学习笔记:ADO.NET基础知识总结
- [ASP.NET笔记] 3.ASP.NET的运行模型