后台利用JS刷新页面(网站)
2014-03-06 15:53
357 查看
1.在后台中的显示添加或修改后的提示信息(提示之后刷新当前页)
ShowMsgHelper.AlertMsg("操作成功!");
2.提示信息的原函数
top.main.windowload();//javascript中的刷新页面代码
public static void AlertMsg(string message)
{
ShowMsgHelper.ExecuteScript(string.Format("showTipsMsg('{0}','2500','4');top.main.windowload();OpenClose();", message));
}
3.将后台的代码反应到前台的JS代码中
public static void ExecuteScript(string scriptBody)
{
string scriptKey = "Somekey";
Page p = HttpContext.Current.Handler as Page;
p.ClientScript.RegisterStartupScript(typeof(string), scriptKey, scriptBody, true);
}
4.FunctionJS.js中的相关代码
//回调
function windowload() {
rePage();
}
/**
刷新页面
**/
function rePage() {
Loading(true);
window.location.href = window.location.href.replace('#', '');
return false;
}
ShowMsgHelper.AlertMsg("操作成功!");
2.提示信息的原函数
top.main.windowload();//javascript中的刷新页面代码
public static void AlertMsg(string message)
{
ShowMsgHelper.ExecuteScript(string.Format("showTipsMsg('{0}','2500','4');top.main.windowload();OpenClose();", message));
}
3.将后台的代码反应到前台的JS代码中
public static void ExecuteScript(string scriptBody)
{
string scriptKey = "Somekey";
Page p = HttpContext.Current.Handler as Page;
p.ClientScript.RegisterStartupScript(typeof(string), scriptKey, scriptBody, true);
}
4.FunctionJS.js中的相关代码
//回调
function windowload() {
rePage();
}
/**
刷新页面
**/
function rePage() {
Loading(true);
window.location.href = window.location.href.replace('#', '');
return false;
}
/** 短暂提示 msg: 显示消息 time:停留时间ms type:类型 4:成功,5:失败,3:警告 **/ function showTipsMsg(msg, time, type) { top.ZENG.msgbox.show(msg, type, time); }
相关文章推荐
- 【干货】利用MVC5+EF6搭建博客系统(四)(上)前后台页面布局页面实现,介绍使用的UI框架以及JS组件
- js iframe网站后台左右收缩型页面脚本
- 利用js刷新页面方法
- 在Vs2008中修改网站后台,刷新页面时不自动编译
- 利用php和js实现页面数据刷新
- html页面 加载完成后只刷新 一次 js 和jquery插件网站
- 利用php和js实现页面数据刷新
- jsp 利用js自动刷新页面
- js iframe网站后台左右收缩型页面脚本
- html页面的数据利用js或者Ajax传输到后台java、php
- JS中利用localStorage防止页面动态添加数据刷新后数据丢失
- 利用js实现对页面的自动刷新
- 利用phantomjs+selenium抓取fund.eastmoney.com/fund.html网站第二页js生成的页面
- 利用js实现对页面的自动刷新
- 利用js实现对页面的自动刷新
- js iframe网站后台左右收缩型页面脚本
- 利用js增加页面点击率(利用setTimeout刷新页面)
- HTML、js:如何利用Location对象的常用属性和方法重新加载、刷新页面
- 利用js控制页面刷新以及返回上一页刷新
- pjax:ajax和pushState结合的js库——实现网站无刷新加载页面