滚动到验证摘要 - ASP.net MVC [英] Scroll to Validation Summary - ASP.net MVC
问题描述
当用户点击我的应用程序,导致验证错误,有没有办法让页面滚动到是否有错误验证摘要位置的按钮?我需要为这两种情况下做到这一点:
When a user clicks a button in my application that causes validation errors, is there a way to have the page scroll to the location of the Validation Summary if there are errors? I need to do this for both cases:
- 客户端验证$ P $从提交pvents页
- 服务器验证重新显示网页
有没有一种简单的方法在MVC做到这一点?
Is there an easy way to accomplish this in MVC?
推荐答案
<一个href=\"http://stackoverflow.com/questions/8885558/jquery-scroll-to-specific-div-position-in-case-of-error-and-focus\">jquery滚动到特定的DIV位置在错误的情况下,专注
&LT; - 这个帖子也有类似的规定 - 规定的解决方案是一个js函数射击上滚动窗口到所需的位置DOM的负载。正确实施,这可能会给客户端和放大器解决方案;服务器端验证。
jquery scroll to specific div position in case of error and focus <-- This post has a similar requirement - the stated solution is a js function firing on dom-load that scrolls the window to the desired position. Correctly implemented, this could create a solution for both client & server side validation.
这篇关于滚动到验证摘要 - ASP.net MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!