胡神

导航

文章分类 -  ASP.NET

页面先提示,后删除
摘要:方案一:<head runat="server"> <title>删除提示</title><script language="javascript">function getMessage() { var Flag=confirm("是否真的要删除?"); if (Flag) { // alert("删除操作"); window.event.returnValue =true; } else { location.href = "B.aspx?"; 阅读全文

posted @ 2011-04-12 20:14 胡神 阅读(315) 评论(0) 推荐(0)

js实现页面提交等待界面
摘要:<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>等待效果</title> <script language="javascript">var times=0;function tick() //用于显示执行的时长{times++;var min=Math.floor(times/60);var scend=times-min*60;document.getElementById(& 阅读全文

posted @ 2011-04-12 19:34 胡神 阅读(4053) 评论(0) 推荐(0)

在url中传递中文的解决方案
摘要:第一步:设置web.config<system><globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312"/></system>或设置aspx<head runat="server"> <title>无标题页</title> <meta http-equiv=" 阅读全文

posted @ 2011-04-12 19:11 胡神 阅读(170) 评论(0) 推荐(1)

页面事件控制
摘要:1.甚至默认焦点<body onload="document.all['TextBox9'].focus();">或 <form id="Form1" method="post" runat="server" defaultfocus="TextBox2">2.回车文本框自动跳转<body onload="document.all['TextBox9'].focus();"> <form id=&quo 阅读全文

posted @ 2011-04-12 18:44 胡神 阅读(157) 评论(0) 推荐(0)

页面刷新方法
摘要:1.实现页面自动刷新:把如下代码加入<head>区域中:<meta http-“refresh” content=“5”>每隔5秒刷新2.页面自动跳转:<meta http-“refresh” content=“5;url=http://www.baidu.com”>3.setTimeout<body onload="setTimeout('history.go(0)',5000)"><body onload="setTimeout('this.location.reload(); 阅读全文

posted @ 2011-04-11 23:14 胡神 阅读(545) 评论(0) 推荐(1)

页面传值方法
摘要:1.get 方式发送页: 1.<a href="WebFormA2.aspx?sum=1">进入WebFormA2.aspx</a><br /> 2.<asp:TextBox ID="TextBox1" Text="litianping" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="进入WebF 阅读全文

posted @ 2011-04-11 22:50 胡神 阅读(206) 评论(0) 推荐(1)

cookie
摘要:写入cookie HttpCookie mycookie = new HttpCookie("UserSettings"); mycookie["UserName"] = username; mycookie["Password"] = password; mycookie.Expires = DateTime.Now.AddMinutes(1); Response.Cookies.Add(mycookie);读取cookie string username = ""; string password = &quo 阅读全文

posted @ 2011-04-11 22:11 胡神 阅读(129) 评论(0) 推荐(0)

asp.net页面生命周期
摘要:1.独立页面生命周期protected void Page_PreInit(object sender, EventArgs e) { Response.Write("Page_PreInit<br/>"); } protected void Page_Init(object sender, EventArgs e) { Response.Write("Page_Init<br/>"); } protected void Page_InitComplete(object sender, EventArgs e) { Respons 阅读全文

posted @ 2011-04-11 22:01 胡神 阅读(147) 评论(0) 推荐(0)