html - 当你有一个成功的模型时如何在 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>
解决方案
推荐阅读
- spring-boot - 具有多部分文件上传的 WebTestClient
- flutter - 如何仅更改材质应用程序中 body 属性的状态,而不是重新渲染整个应用程序?
- c++ - 随着 QScriptEngine 的弃用,我们如何移植 QScriptClass 相关的代码?
- react-native - 如何在本机反应中动态地在url中传递两个以上的值
- javascript - 创建空的 ag-grid 表
- javascript - react-flatpickr 范围选择,两个输入填充第一个输入中的两个日期
- java - 无法使用 TestNG 执行 Headless Geckodriver
- python-3.x - 从 pydoop 访问 hdfs 集群
- amazon-cloudformation - AWS SSM-Agent 未启动
- java - 返回 201 在 Spring Webflux 中具有特定主体的已创建状态