【转】asp.net 页面刷新方法总结
ASP.NET页面刷新方法总结
先看看ASP.NET页面刷新的实现方法:
第一:
private void Button1_Click(objectsender,System.EventArgse)
{
Response.Redirect(Request.Url.ToString());
}
第二:
private void Button2_Click(objectsender,System.EventArgse)
{
Response.Write("<mce:script language=javascript><!--
window.location.href=document.URL;
// --></mce:script>");
}
第三:
private void Button3_Click(objectsender,System.EventArgse)
{
Response.AddHeader("Refresh","0");
}
第四:
privatevoidButton6_Click(objectsender,System.EventArgse)
{
//好像不对
//Response.Write("<mce:scriptlanguage=javascript><!--
window.location.reload();
// --></mce:script>");
}
第五:
<mce:script type="text/javascript"><!--
<!—
varlimit="3:00"
if(document.images)
{
varparselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
functionbeginrefresh()
{
if(!document.images)
return
if(parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if(curmin!=0)
curtime=curmin+"分"+cursec+"秒后重刷本页!"
else
curtime=cursec+"秒后重刷本页!"
window.status=curtimesetTimeout("beginrefresh()",1000)
}
}
window.onload=beginrefresh
// --></mce:script>
<DIVstyle="Z-INDEX:102;LEFT:408px;POSITION:absolute;TOP:232px"ms_positioning="text2D"><P><FONTsize="3">自动刷新页面</FONT></P></DIV>
第六:
<metahttp-equiv="refresh"content="300;url=target.html">
用window.location.href实现刷新另个框架页面
在写asp.net程序的时候,我们经常遇到跳转页面的问题,我们经常使用Response.Redirect,如果客户要在跳转的时候使用提示,这个就不灵光了,如:
Response.Write("<mce:script type="text/javascript"><!--
alert(‘恭喜您,注册成功!’);
// --></mce:script>");
Response.Redirect("main.html");
这时候我们的提示内容没有出来就跳转了,和Response.Redirect("main.html");没有任何区别。
这时我们采用下面代码试验
相关文档:
3个文件
code 类文件
using System;
using System.Text;
namespace ConcreteMIS.Common.Chinese
{
/// <summary>
/// 汉字拼音声母计算类
/// Write by WangZhenlong at 2003/11/29
/// </summary>
......
大家知道,Microsoft为了更好地预防恶意用户和攻击者的攻击,在默认情况下,没有将 IIS6.0 安装到 Windows Server 2003 家族的成员上。而且,当我们最初安装 IIS6.0 时,该服务在高度安全和"锁定"模式下安装。在默认情况下,IIS6.0 只为静态内容提供服务即,诸如 ASP、ASP.NET、在服务器端的包含文件、WebDAV 发布和 FrontP ......
3 mistakes to avoid when using jQuery with ASP.NET AJAX
AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on June 5th, 2008
Over the past few weeks, I think I have definitely embodied Jeff Atwood’s claim that we’re all amateurs, learning together. Despite my best efforts to thoroughly tes ......
using (con)
{
con.Open();
String sqltext = "select * from emp where empno=@empno";
......
第一种:需要引用com :microsoft.excel.11.0.
//生成Excel文件的代码
protected void ExportExcel()
{
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wb = excel.Workbo ......