maintainScrollPositionOnPostBack不起作用,WebForm_SaveScrollPositionSubmit is not defined
来源:互联网 发布:乐乎青年公寓联系电话 编辑:程序博客网 时间:2024/05/17 03:18
asp.net的页面,滚动条位置刷新后不保存上一次位置。
使用的方法为在Web.config添加
<pages maintainScrollPositionOnPostBack="true"/>
但一直不起作用,页面显示 JS报错:
Uncaught ReferenceError: WebForm_SaveScrollPositionSubmit is not defined
Failed to load resource: the server responded with a status of 404 (Not Found)
开始认为是Chrome不支持,最后测试发现是
<httpRuntime 节点影响了,
添加 <httpRuntime targetFramework="4.5" 这个属性后正常,汗!
这是为什么?
Machine.config 文件或根 Web.config 文件中未显式定义 httpRuntime 元素。 但是,以下设置是系统初始化的默认值。 如果需要自定义此节,必须在配置文件中创建它并且只定义那些需要自定义的特性。
<httpRuntime apartmentThreading="false" appRequestQueueLimit="5000" delayNotificationTimeout="5" enable="true" enableHeaderChecking="true" enableKernelOutputCache="true" enableVersionHeader="true" encoderType = "System.Web.Util.HttpEncoder" executionTimeout="110" maxQueryStringLength = "2048" maxRequestLength="4096" maxUrlLength = "260" maxWaitChangeNotification="0" minFreeThreads="8" minLocalRequestFreeThreads="4" relaxedUrlToFileSystemMapping = "False" requestLengthDiskThreshold="80" requestPathInvalidCharacters = "<,>,*,%,&,:,\" requestValidationMode = "4.0" requestValidationType = "System.Web.Util.RequestValidator" requireRootedSaveAsPath="true" sendCacheControlHeader="true" shutdownTimeout="90" useFullyQualifiedRedirectUrl="false" waitChangeNotification="0" />
是因为运行环境与Machine.config不一致?奇怪。
重启动又不行,。。。。
发现和
<machineKey validationKey="3FF1E929BC0534950B0920A7B59FA698BD02DFE8" validation="SHA1" decryptionKey="280450BB36319B474C996B506A95AEDF9B51211B1D2B7A77" decryption="3DES"/>
有关。
验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGenerate
主要的原因是解决提交了名为__VIEWSTATE的数据,ASP.NET的验证视图状态的时候失败。而加的解决方案。
1、去掉 runat="server"
2、添加enableEventValidation="false" enableViewStateMac="false"
或在webconfig中添加<pages enableEventValidation="false" enableViewStateMac="false" />
3、在webconfig中添加:<machineKey validation="3DES" validationKey="319B474B1D2B7A87C996B280450BB36506A95AEDF9B51211" decryption="3DES" decryptionKey="280450BB36319B474C996B506A95AEDF9B51211B1D2B7A87" />
- maintainScrollPositionOnPostBack不起作用,WebForm_SaveScrollPositionSubmit is not defined
- 'WebForm_SaveScrollPositionSubmit' is undefined
- Ext is not defined
- $ is not defined error
- $ is not defined error
- dojo is not defined!
- $ is not defined
- $ is not defined 问题
- Ext is not defined
- Ext is not defined
- $ is not defined
- jQuery is not defined
- ReferenceError: $ is not defined
- Ext is not defined
- $ is not defined
- d3 is not defined
- CERT_NONE is not defined
- Ext is not defined
- epoll 事件类型
- 记住用户名(在多长时间不用重复登录)
- Nginx负载均衡
- 过去几个月出炉的30款最喜欢的 jQuery 插件
- iOS 在tableView上添加button导致按钮没有点击效果和不能滑动的问题
- maintainScrollPositionOnPostBack不起作用,WebForm_SaveScrollPositionSubmit is not defined
- RGB查看器
- 中科院&上海远丰达成战略合作 共同推进中国电商发展
- Eclipse中关联support源码
- 【网络协议】互联网协议入门(一)
- 初学ios的一些笔记
- 从item-base到svd再到rbm,多种Collaborative Filtering(协同过滤算法)从原理到实现
- 打开vi编辑器出现E325: ATTENTION的解决方法
- 给控件设置text时错误