首页 > 解决方案 > 当你有一个成功的模型时如何在 mvc 中调用一个函数

问题描述

我有以下 html 片段。当我登录时从我的模型中获得成功的响应时,我如何调用下面提到的函数。

@model LoginModel
    <div class="row-fluid">
          
    
     @using (Html.BeginForm("Login", "Account", FormMethod.Post, new {id = "login", @class = "form-horizontal "}))
            {
                @Html.ValidationSummary(true, null, new {@class = "alert alert-error"}) //when i get an error here it displays correctly.
    
            **//how do i in here when my @model is succesful in login some one in call the below new_popup() message?**
               
    }
    <script type="text/javascript">
        function new_popup() {
            var popupwin = window.open('http://www.google.com', 'anyname', 'width=10,height=1,left=5,top=3');
            setTimeout(function () { popupwin.close(); }, 5000);
        }
    </script>

标签: htmlasp.net-mvcmodel-view-controller

解决方案


推荐阅读