摘要:
其中 '2016/03/15'是參數DATE, '2016/03/15 19:03'為開始時間, '2016/03/15 19:10'為結束時間, l.empno =:參數-- '9409872' 共分別為4種情況: 阅读全文
摘要:
string str = "abc"; 1.字符大小写转化 大写:str.ToUpper(); 小写: str.ToLower(); 2.字符和Ascii码互相转换 Ascii码:byte[] b = Encoding.GetEncoding("unicode").GetBytes(str);字符串 阅读全文
摘要:
1.querystring的方式:将需要的值直接写到链接的后面,这些内容将直接显示到地址栏中,在传递安全性要求不高的一个或多个值或者是结构简单的值就可以使用这样的方法。如: Response.Redirect( "target.aspx?param1=hello¶m2=hi ")在接收页面可以通过r 阅读全文
摘要:
1.前台代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridViewCheckbox.aspx.cs" Inherits="GridViewCheckbox" %><!DOCTYPE html PUBLIC "-//W3C//D 阅读全文
摘要:
gridview里有一列绑定的数据很长,显示的时候在一行里面显示,页面拉得很宽。原因是连续英文段为一个整体导致的, 在RowDataBound中添加上了一句e.Row.Cells[2].Style.Add("word-break", "break-all")就可以。如果要给所有的列增加此属性:pro 阅读全文
摘要:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e){ switch (e.Row.RowType) { case DataControlRowType.Header: //第一行表头 TableCell 阅读全文
摘要:
/// <summary> /// 导出Excel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, Ev 阅读全文
摘要:
要实现GrdView分页的功能。操作如下: 1、在<<asp:GridView ID=......>后添加,1)、更改GrdView控件的AllowPaging属性为true。2)、更改GrdView控件的PageSize属性为 任意数值(默认为10)3)、更改GrdView控件的PageSetti 阅读全文
摘要:
在GridView模版列中设置如下 1 <asp:TemplateField HeaderText="删除"> 2 <ItemTemplate> 3 <asp:CheckBox ID="CheckBox1" runat="server" /> 4 </ItemTemplate> 5 </asp:Te 阅读全文
摘要:
DataTable dtTmp { get { if (ViewState["dtTmp"] == null) { return null; } return ViewState["dtTmp"] as DataTable; } set { ViewState["dtTmp"] = value; } 阅读全文