1
我想要显示模式窗口,当用户点击需要验证的操作时。 我看到这个问题的答案: ASP.NET MVC Authorize Attribute to launch a modal?授权属性和模态对话框
我从答案,并在文件中的Site.Master得到PopupAuthorizeAttribute写道:
<% if((bool)(ViewData["OpenAuthorizationPopup"] ?? true)) { %>
<script type="text/javascript">
alert("Login needed")</script> **for test
<% } %>
消息显示,只有当页面加载。但是当我点击一个动作(使用PopupAuthorize)时,动作无论如何都会起作用。