【转】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");没有任何区别。
这时我们采用下面代码试验
相关文档:
译文原文地址
http://www.cnblogs.com/hl13571/archive/2008/01/28/1056671.html
英文原文地址
Understanding Single Sign-On in ASP.NET 2.0
理解ASP.NET 2.0中的单点登录
Published: 16 Jan 2008
摘要
在这篇文章中,Masoud讨论了应用ASP.NET中统一身份验证模型进行跨应用程序验证的问题,包括:Membership Prov ......
大家知道,Microsoft为了更好地预防恶意用户和攻击者的攻击,在默认情况下,没有将 IIS6.0 安装到 Windows Server 2003 家族的成员上。而且,当我们最初安装 IIS6.0 时,该服务在高度安全和"锁定"模式下安装。在默认情况下,IIS6.0 只为静态内容提供服务即,诸如 ASP、ASP.NET、在服务器端的包含文件、WebDAV 发布和 FrontP ......
开发平台:
WinXP SP3+IIS5.1+IE7+Visual Studio 2005+Visual Studio 6.0+ MS SOAP Toolkit 3.0
一.创建ASP.NET WebService
Visual Studio 2005à文件à新建à网站àASP.NET Web服务项目WebServiceDemo。
以下为Service.cs代码清单:
// WebService.cs
using System;
using System ......
JSON Serialization and Deserialization in ASP.Net
I was looking around for a simple example which would just do an object serialization to a JSON format, and then deserializing back to the original object. I found few examples on MSDN, but did seem to be too long ......
ASP.NET 2.0服务器控件开发----控件生命周期
服务器控件生命周期简介
服务器控件的生命周期是创建服务器控件最重要的概念。作为开发人员,必须对服务器控件生命周期深刻理解。当然,这不是一朝一夕就可以做到的。对于学习控件开发技术的初学者,可以不必掌握得非常详细深入,只需对服务器控件的生命周期中的不同 ......