在asp.net中关闭模式对话框形式 [英] close modal dialog form in asp.net

查看:83
本文介绍了在asp.net中关闭模式对话框形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中自动关闭模式对话框.

我尝试使用window.close()选项关闭aspx窗口

但它正在询问一个安全性问题,您是否要关闭窗口.

如果我选择是",则窗口将关闭.

我不想问任何问题.

how to close modal dialog form in asp.net automatically.

I try to close the aspx window using window.close() option

but it is asking a security question do you want to close the window.

if I select yes then the window get closed.

I dont want to ask any question.

推荐答案

尝试一下:

Try this:

//in Codebehind file "abc.cs"
private void CloseDialog()
    {
        string script = "window.close();";
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), 
         "CloseWindow", script, true);
    }


这篇关于在asp.net中关闭模式对话框形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆