易截截图软件、单文件、免安装、纯绿色、仅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项目中全局变量使用的方式。web.config文件 和 Gloab文件。以下分别说明:
方法一:web.config文件
——设置:
在web.config文件里添加关键字key是通过<appSettings>标记来实现的,但是appSettings标记通常放在<system.web>.....</system.web>标记外面。例:
<conf ......

将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 导出Excel方法汇总

第一种:需要引用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 ......

在ASP.NET中读写Excel文件有四种解决方案。

在ASP.NET应用程序常常会遇到需要从Excel文件中读取数据或将数据写入Excel的需求。一般来讲,在ASP.NET中读写Excel文件有四种解决方案。
1.1.1 使用OLE DB
使用OLE DB可以以查询数据库的方式来读取Excel文件,因为在某种程度上Excel表格可以看成是一张一张的数据表。其二者的主要区别在于所使用的数据引擎不一样。使用OLE ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号