BZ这篇博客主要是为大家介绍一下MVC如何弹出模态框。本文如果有什么不对的地方,希望大神们多多指教,也希望和我一样的小菜多多学习。BZ在这里谢过各位。

首先要在页面加上一个点击事件: 

@Html.ActionLink("预览","",null, new { onclick = "dianji('" + item.TypeCode + "')" });

接下来我们需要写一段JS:

<script type="text/javascript">
        function dianji(obj)
        {
            debugger;
            window.showModalDialog("/Type/May?TypeCode="+obj,null,"dialogWidth:400px;dialogHeight:500px;status:no;help:no;resizable:yes;");
        }
    </script>
View Code

相关文章:

  • 2021-07-14
  • 2021-09-05
  • 2022-12-23
  • 2021-04-23
  • 2022-12-23
  • 2021-06-29
  • 2021-06-21
猜你喜欢
  • 2021-06-26
  • 2022-02-11
  • 2021-12-15
  • 2021-08-31
  • 2021-09-17
  • 2021-06-24
相关资源
相似解决方案