asp.net - asp.net 和弹出窗口停止使用 Chrome
问题描述
非常简单的代码,但很难找到其他可行的方法:
Private Sub Page_Load(ByVal sender as System.Object, ByVal e as System.EventArgs) Handles MyBase.Init
If Not Me.IsPostBack Then
'bunch of code here
Else
Dim strUrl As String = "Alarm.aspx?ID=" & myAlarm.Rows(0).Item(0)
ClientScript.RegisterStartupScript(GetType(Page), "Alarm", "<script language='javascript'>window.showModalDialog('" & strUrl & "',null,'dialogWidth=460px;dialogHeight=310px;status=no;resizable=yes;');document.frmAutolog.submit();</script>")
End If
Else
该代码在 IE 中运行良好,并且直到最近在 Chrome 中运行良好。
我尝试使用以下内容,但无法正常工作:
Dim pop as string = "window.open('" & strUrl & "', 'popup_window', 'dialogWidth=460px,dialogHeight=310px,status=no,resizable=yes');"
ClientScript.RegisterStartupScript(Me.GetType(),"script", pop, True)
页面本身有很多代码,这个版本的弹出窗口只会在手动刷新屏幕后发生,而不是在从提交按钮回发后立即发生(就像原来的 IE 和 Chrome 一样)。
背景:数据输入到这个页面,如果数据超出范围,那么提交后会立即弹出
解决方案
推荐阅读
- r - 使用 xlsx 包从 R 中导出的文件名中删除空格
- jquery - 如何使用 Jquery contextMenu X2 更新 contextMenu
- javascript - 用 Jest 模拟 Typescript 中导入函数的返回值
- javascript - onDoubleClick() 不适用于手机反应 js 应用程序
- php - 未定义的偏移量:php 中的 1
- asp.net-core - 生成 CrypoAPI (CAPI) 私钥
- asp.net - CLR 类型到 EDM 类型的映射是不明确的,因为有多个 CLR 类型;没有找到解决方案
- python - 如何使用 pytest 在循环中使用断言
- html - 悬停时显示全尺寸图像
- powerbi - 在 Power BI 中使用 USERNAME() 测量 if 条件