易截截图软件、单文件、免安装、纯绿色、仅160KB

【转】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");没有任何区别。
这时我们采用下面代码试验


相关文档:

asp.net中的异步页面


要想了解asp.net 2.0的异步页的处理过程,先列出页面的生命周期:
1 :Init 事件: 页面初始化 ,初始化设置。
2: LoadViewState方法: 加载视图状态, 填充ViewState属性。
3 :LoadPostData方法: 处理回发数据, 处理传入窗体数据。
4: Load 事件: 加载页面 ,页面控件初始化完成并反映了客户端的数据。
5 :Ra ......

JSON Serialization and Deserialization in ASP.Net


    
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 ......

将jQuery应用于Asp.net Ajax时,应避免的3个错误

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 ......

asp.net防sql注入

 using (con)
        {
            con.Open();
            String sqltext = "select * from emp where empno=@empno";
      ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号