如何使用Javascript

时间:2016-07-28 06:26:49

标签: javascript jquery asp.net modalpopupextender

在ASP.Net中我使用modalpopupextender出于某种原因显示模态弹出窗口,即modalpopupextender工作正常。但我的问题是我需要在完成任务后显示简单的模态弹出窗口。任务是否成功显示成功消息并行失败还有一个更重要的是我需要隐藏modalpopupextender。我试过使用javascript,它显示警告信息,但modalpopupextender不会隐藏,下面是代码

 if (finalresult == 1)
            {
                 modalpopup.Hide();
                 Response.Write("<script>alert('Done');</script>"); // if success  display success  message
            }
            else
            {
                Response.Write("<script>alert('Error');</script>"); // if fail display error msg

            }

而不是使用警报脚本,我可以使用任何javascript或jquery模式弹出包括我需要平行隐藏modalpopupextender请帮助我。

1 个答案:

答案 0 :(得分:1)

您提到可以使用jQuery。考虑到这一点,希望您可以包含jQuery的UI插件,jQuery UI

&#13;
&#13;
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script>
<script>
  $(function() {
    $("#dialog").dialog();
  });
</script>
<!-- -->
<div id="dialog" title="Title here">
  <p>Dialog text here</p>
</div>
&#13;
&#13;
&#13;

相关问题