简体   繁体   English

从asp.net代码后面打开Javascript的ShowModalDialog

[英]open ShowModalDialog of Javascript from asp.net code behind

How to open ShowModalDialog of Javascript from asp.net code behind (C#). 如何从(C#)中的asp.net代码打开Javascript的ShowModalDialog。 Please provide me the code if possible and one more thing which i want to mention that , im using Script manager on my page from where i want to open the pop up. 请提供代码(如果可能的话)以及我想提及的一件事,我想在我要打开弹出窗口的页面上使用脚本管理器。

call javascript function from code behind .... 从后面的代码中调用javascript函数。

ClientScript.RegisterStartupScript(GetType(),"hwa","Samplefn();",true);

write the following code ...in javascript: 在javascript中编写以下代码...

function samplefn()
{
 $("#dialog-form").dialog("open");
}

the above code used to open model dialog 上面的代码用来打开模型对话框

$(function() {
            $("#dialog-form").dialog({
                autoOpen: false,
                minHeight: 50,
                position: [300, 50],
                height: 'auto',
                width: 400,
                modal: true
            });
        }); 

otherwise you can directly open model dialog from code behind.. 否则,您可以从后面的代码直接打开模型对话框。

   ClientScript.RegisterStartupScript(GetType(),"hwa"," $('#dialog-form').dialog('open');",true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM