当前位置: 首页 > news >正文

刷新页面-后台

namespace YJSBCL.common
{public class Refresh {#region 刷新父、子页面/// <summary>/// 刷新父页面/// </summary>public void RefreshParentPage(SlnSuwfPage _page){//_page.btnQuery_Click(null, null);string strJS = "<script type='text/javascript'>"+ "var pWindow = window.parent.opener;"+ "if(pWindow != null && pWindow.document.all.btnQuery != null)"+ "{pWindow.document.all.btnQuery.click();}"+ "pWindow = window.parent.parent;"+ "if(pWindow != null && pWindow.gridframe != null && pWindow.gridframe.document.all.btnQuery != null)"+ "{pWindow.gridframe.document.all.btnQuery.click();}"+ " </script>";_page.ClientScript.RegisterStartupScript(this.GetType(), "RfreshParent", strJS);}
#endregion#region 刷新父、子页面/// <summary>/// 刷新子页面/// </summary>public void RefreshChildPage(SlnSuwfPage _page){//_page.btnQuery_Click(null, null);string strJS = "<script type='text/javascript'>"+ "var pWindow = window.parent;window.parent.cardframe.document.location.reload();"+ " </script>";_page.ClientScript.RegisterStartupScript(this.GetType(), "RfreshChild", strJS);}#endregion}
}
public static void RefreshPage(SlnSuwfPage page)
{string strScript = @"<script>var pWindow=window.parent.parent.parent;                                   pWindow.location.reload(true);   </script>";page.Response.Write(strScript);}public static void RefreshParentPage1(SlnSuwfPage page)
{StringBuilder sb = new StringBuilder();sb.Append("<script>\n");sb.Append("pWindow = window.parent.parent;\n");sb.Append("if(pWindow != null && pWindow.gridframe != null && pWindow.gridframe.document.all.btnQuery != null)\n");sb.Append("{pWindow.gridframe.document.all.btnQuery.click();}\n");sb.Append("</script>");page.Response.Write(sb.ToString());
}//刷新父页面
StringBuilder sb = new StringBuilder();sb.Append("<script>\n");sb.Append("pWindow = window.parent.parent;\n");sb.Append("if(pWindow != null && pWindow.gridframe != null && pWindow.gridframe.document.all.btnQuery != null)\n");sb.Append("{pWindow.gridframe.document.all.hfRefresh.value=1;pWindow.gridframe.document.all.btnQuery.click();}\n");sb.Append("pWindow = window.parent.opener;\n");sb.Append("if(pWindow != null && pWindow.document.all.btnQuery != null)\n");sb.Append("{pWindow.document.all.btnQuery.click();}\n");sb.Append("</script>");
page.Response.Write(sb.ToString());public static void RefreshSelf(SlnSuwfPage page)
{string strScript = @"<script>var pWindow=window.parent;pWindow.location.reload(true);   </script>";page.Response.Write(strScript);
}public static void RefreshOpener(SlnSuwfPage page){StringBuilder sb = new StringBuilder();sb.Append("<script>\n");sb.Append("var pWindow = window.parent.opener;\n");sb.Append("if(pWindow != null)\n");sb.Append("{pWindow.location.reload(true);}\n");sb.Append("</script>");page.Response.Write(sb.ToString());
}
#region
public static void RefreshSelf(SlnSuwfPage page){//刷新当前页面,尤其是用于网格string strScript = @"<script>window.location.href=window.location.href;   </script>";page.ShowMessage(strScript);}
#endregion
//关闭子页面,刷新父页面 StringBuilder sb = new StringBuilder();sb.Append("<script>\n");sb.Append("var p = getParentWin();\n");sb.Append("p.location.href = p.location.href;\n");sb.Append(" closeWin();\n"); sb.Append("</script>");_page.ShowMessage(sb.ToString());

  

http://www.sczhlp.com/news/2134/

相关文章:

  • 大道至简》读后感:从“码农”到“工程师”的顿悟
  • 中国背景的APT41组织在非洲展开新型网络攻击
  • 使用Python进行简单的数据清洗
  • SkiaSharp 使用 HarfBuzz 修复找不到 Symbol 字形
  • 读心与芯:我们与机器人的无限未来09读后总结与感想兼导读
  • [USACO05DEC] Cow Patterns G 代码
  • P4551 最长异或路径 The XOR-longest Path 题解
  • 「NOI2017」蚯蚓排队 (哈希链表)
  • 背单词(非题解,仅代码,不过代码有注释)
  • P5569 一个古老的石头游戏An old Stone Game 题解
  • 加密货币钱包安全改进方案:从钓鱼攻击到智能合约验证
  • 饥荒单机版实用脚本【减伤发光】(控制台函数、无需添加mod,修改单个游戏文件即可)
  • 饥荒单机版实用脚本(控制台函数、无需添加mod,修改单个游戏文件即可)
  • 饥荒单机版实用脚本
  • CF2128E - NEUQ
  • 读《大道至简》:写给踏入大学一年后仍然迷茫的自己
  • 2025暑训日记
  • Solar应急响应月赛-7月 WP
  • 试试看 Monica AI 有没有什么新的进步
  • 第三十一天
  • 20250730 之所思 - 人生如梦
  • 第十四章 设计YouTube
  • 我独自升级—北の救赎之路(2025)
  • 一段旅程的结尾
  • PerfDog 试用
  • Prism 从入门到精通(学习笔记)—— 为初学者准备的通俗指南
  • 面向工业4.0的AI Agent多任务协作与调度系统设计
  • 百天打卡
  • Prism 从入门到精通(小白版)
  • 基于YOLOv8的包装箱纸板破损缺陷识别项目|完整源码数据集+PyQt5界面+完整训练流程+开箱即用!