“WebForm_PostBackOptions” ASP.Net 网站上出现未定义错误
我的预编译 ASP.Net 4 网站刚刚在按钮单击事件上出现了 JavaScript 错误,该事件应该回发到另一个页面。
我以前从未见过此错误,并且该网站正在运行。我到底做了什么?我什至不知道要向您展示什么代码???
在VS2010中调试时页面工作正常。
我希望今天启动该网站,因此我们将不胜感激。
My precompiled ASP.Net 4 website has just developed a JavaScript error on a button click event that is supposed to postback to another page.
I have never seen this error before and the site was working. What the heck have I done? I'm not even sure what code to show you???
The page works fine when debugging in VS2010.
I was hoping to launch the site today so any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我实际上从未找到导致每个带有回发的按钮生成错误的原因。不过我确实发现早期版本工作正常。所以我逐页重建了网站,错误就消失了。酒吧一!
这是在订单页面上并生成相同的错误(空 axd 文件等)。但这次我能够追踪到这部分代码:
修改代码以
......修复它。
我对使用 ToString() 有点过于热心了!希望这能帮助其他人解决同样的问题。
I never actually found what was causing every button with a postback to generate the error. However I did find that an earlier version was working OK. So I reconsrtructed the site, page by page and the error went. Bar one!
This was on the order page and generated the same error (empty axd files etc). But this time I was able to track it down to this section of code:
Amending the code to...
...fixed it.
I was being a little over zealous with using ToString()! Hopefully this will help someone else with the same issue.