|
你可以在不想被緩存的頁面Page_Load事件中加上如下代碼
復制代碼 代碼如下:
Response.Expires = 0;
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";
編譯成DLL:
“開始”―“運行”―“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導出到Excel代碼2:
復制代碼 代碼如下:
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();
}
提示并跳轉:
復制代碼 代碼如下:
ScriptManager.RegisterStartupScript(this.Page, GetType(),
"askAndRederect", "alert('請先登錄!');window.location.href='Index.ASPx';", true);
GridView中刪除某一行前詢問:
復制代碼 代碼如下:
((LinkButton)e.Row.Cells[4].Controls[2]).Attributes.Add("onclick", "Javascript:return confirm('您確認要刪除嗎?')");
GridView隔行變色代碼:
復制代碼 代碼如下:
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'");
//當鼠標移開時還原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
ASP.NET 正則表達式:
復制代碼 代碼如下:
//驗證手機號
Regex r = new Regex(@"^(13|15|18)/d{9}$");
return r.IsMatch(mobilePhone);
//帶86或者+86的手機號
Regex regexMobile = new Regex(@"^((/+86)|(86))?(13|15|18)/d{9}$");
//驗證是否為中文
Regex regex = new Regex("^[一- 主站蜘蛛池模板: 免费乱理伦片在线观看夜 | 纯肉腐文高H总受男男 | 国产短视频精品区 | 久草在线精彩免费视频 | 全球真实小U女视频合集 | 国产精品一区二区四区 | 久久天天躁狠狠躁夜夜呲 | 欧美精品乱码99久久蜜桃 | 国产精品成人无码久免费 | WWW国产精品内射老师 | 亚洲人成电影网站色2017 | 国产精品久久高潮呻吟无码 | 迈开腿让我看下你的小草莓声音 | 午夜福利理论片在线播放 | 狼群资源网中文字幕 | 国产色精品久久人妻无码看片软件 | 亚洲午夜电影 | 蜜桃最新网址 | 日韩男明星 | 色多多污版app下载网站 | 第一福利视频网站在线 | 免费国产午夜理论不卡 | 伦理片92伦理午夜 | 蝴蝶中文娱乐 | 三级黄毛片| 久久88综合 | 成人毛片在线播放 | 亚洲午夜久久久久中文字幕 | 99精品热视频30在线热视频 | 青青草久久 | 成人毛片免费观看视频大全 | 亚洲中文字幕国产综合 | 三叶草成人 | 蜜桃最新网址 | 国产在线中文字幕 | 放射源分类办法 | 国内精品久久人妻无码HD浪潮 | 伊人久久电影院 | 无敌在线视频观看免费 | 国产成人在线免费观看 | 国产视频这里只有精品 |