[英]How to show Validation Summary in MessageBox?
I try to do dynamic validation summary. 我尝试做动态验证摘要。 As you see this picture , I want to show validation summary as in bubble next to button.
正如你看到这张照片 ,我想说明验证摘要在旁边的按钮泡沫。 However I can't.
但是我不能。
@{
ViewBag.Title = "Yönetim Giriş";
Layout = "~/Views/Shared/_LoginLayout.cshtml";
var a = Html.ValidationSummary(true, "Hatalı giriş. Lütfen tekrar deneyiniz.");
}
I can get my validation summary with using var a
. 我可以使用
var a
获得验证摘要。 I want to show this message in bubble or in message box. 我想在气泡或消息框中显示此消息。
-EDİT- -编辑-
<tr> <td align="right" colspan="2">
@Html.DialogFormLink("Şifremi Unuttum", Url.Action("SifreUnuttum"), "Şifre Hatırlama", "ProfileContainer", Url.Action("Login"))
<input type="submit" value="Log In" onclick="javascript:alert();" />
</td> </tr> </table>
<script>
function alert(){
alert(@Html.ValidationSummary(true, "Hatalı giriş. Lütfen tekrar deneyiniz."))
}
</script>
You need to change name of you function: 您需要更改函数名称:
<script>
function alert(){
alert(@Html.ValidationSummary(true, "Hatalı giriş. Lütfen tekrar deneyiniz."))
}
</script>
you named you function alert() which is function of alert window in js. 您将函数命名为alert(),它是js中的警报窗口的函数。 So you are making infinite loop for calls.
因此,您正在使呼叫无限循环。 You got stackoverflow :P
你有stackoverflow:P
use Ctrl+shif+J you can find js errors there 使用Ctrl + shif + J可以在其中找到js错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.