|
你可以在不想被緩存的頁(yè)面Page_Load事件中加上如下代碼
復(fù)制代碼 代碼如下:
Response.Expires = 0;
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";
編譯成DLL:
“開始”―“運(yùn)行”―“cmd” ,用下面的兩條命令編譯AuthCode.cs文件為.DLL文件。(AuthCode.cs文件保存在“C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727”目錄下)命令如下:
cd C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727
csc /target:library AuthCode.cs
GridView導(dǎo)出到Excel代碼2:
復(fù)制代碼 代碼如下:
public override void VerifyRenderingInServerForm(Control control)
{
//(必須有)
//base.VerifyRenderingInServerForm(control);
}
public void Generate(string Typename, string scswId, GridView TempGrid)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "utf-8";
string Filename = Typename + scswId + ".xls";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "online;filename=" + Filename);
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
HttpContext.Current.Response.ContentType = "application/ms-excel";
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
TempGrid.RenderControl(oHtmlTextWriter);
HttpContext.Current.Response.Write(oStringWriter.ToString());
HttpContext.Current.Response.End();
}
提示并跳轉(zhuǎn):
復(fù)制代碼 代碼如下:
ScriptManager.RegisterStartupScript(this.Page, GetType(),
"askAndRederect", "alert('請(qǐng)先登錄!');window.location.href='Index.ASPx';", true);
GridView中刪除某一行前詢問(wèn):
復(fù)制代碼 代碼如下:
((LinkButton)e.Row.Cells[4].Controls[2]).Attributes.Add("onclick", "Javascript:return confirm('您確認(rèn)要?jiǎng)h除嗎?')");
GridView隔行變色代碼:
復(fù)制代碼 代碼如下:
protected void GVLinkman_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");
//當(dāng)鼠標(biāo)移開時(shí)還原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
ASP.NET 正則表達(dá)式:
復(fù)制代碼 代碼如下:
//驗(yàn)證手機(jī)號(hào)
Regex r = new Regex(@"^(13|15|18)/d{9}$");
return r.IsMatch(mobilePhone);
//帶86或者+86的手機(jī)號(hào)
Regex regexMobile = new Regex(@"^((/+86)|(86))?(13|15|18)/d{9}$");
//驗(yàn)證是否為中文
Regex regex = new Regex("^[一- 主站蜘蛛池模板: 国产精品高清视亚洲一区二区 | 青青国产成人久久91网站站 | 丁香婷婷在线观看 | 亚洲国产高清一区二区三区 | 亚洲欧洲视频在线 | 黄色美女视频网站 | 一区二区视频网 | 久久怡红院国产精品 | 91色在线观看 | 国产精品一区视频 | 狂野欧美性猛交xxxx免费 | 综合视频在线 | 国产级a爱做片免费观看 | 中日韩新区 | 婷婷影院在线综合免费视频 | 五月天色婷婷综合 | 风间由美一区二区播放合集 | 国产 欧美 日产中文 | swag系列国产精品 | 午夜在线视频国产 | 久久久久国产精品美女毛片 | 天天综合网网欲色 | 国产精品亚洲自在线播放页码 | 999国内精品永久免费视频 | 国产1页| 日韩欧美激情视频 | 亚洲激情视频网 | 国产精品福利一区 | 888米奇四色极速在线观看 | 国产精品美女在线 | 中文字幕无限乱码不卡2021 | 国产精品久久久久影视不卡 | 国产成品精品午夜视频 | 日韩美女色高清在线看 | 中文字幕91在线 | 欧美综合第一页 | 久久久久久91香蕉国产 | 亚洲一区精品中文字幕 | 加勒比视频网站 | 亚洲精品视频在线免费 | 欧美成人亚洲国产精品 |