本文介绍了ASP.Net后超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坚持asp.net后的问题与过去的2周。

I am stuck with asp.net post issue with last 2 weeks.

方案:

我的应用程序页面有3个控制。所见即所得的编辑器(免费文本框),一个文本框来获取物品的名称正在编辑的所见即所得的编辑器,另一个文本框接受关键词。

My application page has 3 controls. A WYSIWYG editor (Free Textbox), a text box to get name of the article being edited in WYSIWYG editor, another text box to accept key words.

订单页面的控件从上到下如下,
 第一,名称文本框中
 第二,所见即所得的编辑器
 最后,关键词文本框

Order of the controls in page from top to bottom as follows,
first, Name text box
second, WYSIWYG Editor
last, Key Word text box

问题:

在以往用户试图保存他们的编辑的文档,IIS服务器将返回超时(生产运行在Win 2008)。但有趣的是,名称文本框中所见即所得的编辑器的信息,另一半(其不完全的一半,其变化对每个案件)信息保存到数据库中。但最后的关键字文本框中不会被保存。在此Web服务器挂起了一阵,踢出用户,后来几分钟恢复正常后速度。我认为,应用程序池被回收。但是,一切工作正常,在我的开发环境(在我的电脑上运行在Win 7 64位)。另外我有设置在页面指令,生产和开发环境ValidateRequest =FALSE。

When ever users tries to save their edited documents, IIS server returns time out (Production runs on win 2008). But interestingly, "Name text" box information and half of WYSIWYG Editor (its not exactly half, it varies for each case) information is saved to database. but last "keyword text" box is not saved. During this web server hangs for a while, kicks out the user and later after few mins back to normal speed. I think app pool is recycled. But all works fine on my development environment (in My PC runs on Win 7 64bit). Also i have set ValidateRequest="False" in page directive for Production and Development environment.

环境:

环境.NET 4.0,ASP.NET
FreeText的盒子所见即所得的编辑器
共享主机的Windows 2008
SQL Server 2008的

Environment .NET 4.0, ASP.NET
FreeText box WYSIWYG editor
Shared Hosting windows 2008
SQL Server 2008

试过解决方案(但没有突破):

试着用不同的浏览器火狐,Chrome,IE浏览器和同样的错误。
在页面指令添加ValidateRequest =FALSE换成所见即所得的编辑器与普通文本框,并试图挽救,同样的问题。
只是试图从page.request对象直接登录后的数据。仍然得到完整的数据为Name文本半所见即所得的文本框,并没有休息。
有对数据库连接或表字段没有问题。我已经三重检查。

Tried with Different Browser Firefox, chrome, IE and same error.
Added ValidateRequest="False" in page directive and replaced WYSIWYG editor with plain text box and tried to save, same issue.
Just tried to log the post data directly from page.request object. Still getting full data for "Name textbox" half for WYSIWYG textbox and nothing for rest.
There is no issue on DB connection or table field. I have triple checked.

可能的怀疑和问题:

根据我所知,在后期数据长度没有限制。但在IIS是有可能重写此?想知道如果这是设置在我的共享主机。
基本上HTTP POST数据得到的地方浏览器和server.request物体之间截断。会是什么原因,如果发生这种情况?
如果HTTP POST被截断,为什么整个应用程序挂起(或重新启动)?
什么是precaution需要发布的HTML内容,HTTP POST时,必须考虑?

Based on my knowledge there is no limitation on post data length. but in IIS is it possible to override this ? wondering if this is set on my shared hosting.
Basically http post data gets truncated somewhere between browser and server.request object. What would be the reason if this is happening?
If http post is truncated why whole application hangs (or restarts)?
What are the precaution need to be taken when posting html content as http post?

感谢你。

新发现:

使用httpfox经过我的职务。帖子大小约为9958字节。但Firefox先发330个字节的数据,然后网页挂起。约一分钟后,我得到的httpfox NS_ERROR_NET_RESET错误code。

Checked my post using httpfox. Post size was about 9958 bytes. But firefox sends first 330 bytes of data and then web page hangs. After about a minute, i am getting NS_ERROR_NET_RESET error code in httpfox.

经过使用filder2与IE9我的职务。它试图发送前512个字节,然后挂起。返回ReadResponse()失败:服务器没有返回该请求的响应。

Checked my post using filder2 with IE9. It tries to send first 512 bytes then hangs. Returns "ReadResponse() failed: The server did not return a response for this request."

问:

这可能会是浏览器的问题或服务器的问题。我想,如果浏览器的问题,这不会发生的IE和Firefox。

This likely would be browser issue or server issue. I think if browser issue, this wont happen for IE and Firefox.

更新:

最有可能对孤立的网络托管的问题。通过改变表单提交的URL不同的域,看看是否值可以被检索在该域进行测试。是的,它的工作原理。只为我的域名没有工作。有趣的是我测试的正常html页面后。它也没有工作。因此,最有可能的安全安装到prevent这或服务器配置错误。已经把票给他们,并等待。

Most likely isolated the problem towards web hosting. Tested by changing form post url to different domain and see if values can be retrieved at that domain. Yes it works. Only it didn't work for my domain. Interestingly i tested this for normal html page post. it also didnt work. So most likely a security installed to prevent this or server misconfiguration. Already put a ticket to them and waiting.

任意如何所有的反馈帮我找出问题。

Any how all of your feed back helped me to isolate the problem.

解决:

是这个问题是在我们的网络托管网站。到目前为止,我从他们那里听到的是像一些防火墙阻止来自HTTP的大文章。他们说,现在我们的域名列入白名单。反正,现在它的作品。但是,这吃了2周我的时间,但它是很好的学习机会。谢谢你们的帮助。真的AP preciated。

Yes this issue was on our web hosting site. So far i heard from them is like some firewall blocking the big post from http. They said now our domain is white listed. Anyway, now its works. But this ate 2 weeks of my time, but it was good learning experience. Thanks guys for your help. Really appreciated.

推荐答案

我也面临着同样的错误在一个网页。它是非常连线,因为如果我是使用代理服务器,错误走的路,如果我是从我的电脑直接叫我有时间了,从来没有去。

I have face the same error on one web page. Its was very wired because if I was use proxy, the error go way, if I was called from my computer direct I have time out, and never go on.

,这个问题出现的网站到现在为止DEC / 2011年是 http://www.auctionsniper.com/同样的网站工作,如果我去了它的移动版本。

The site that this issue appear until now Dec/2011 is the http://www.auctionsniper.com/The same site works if I go with the mobile version of it.

许多检查上述网站,我发现这个问题是有很大的视图状态之后! 我如何找到它:我救我的网页的HTML的一部分,因为它的渲染,并开始删除从HTML物品及重要岗位,直到我发现后继续当我砍倒了视图状态后。

After many checks with the above site I discover that the problem was with the very big viewstate !. How I find it: I save an html part of my page, as its rendered and start remove items from the html and make post, until I discover that the post continue when I cut down the viewstate post.

解决的办法是禁用许多非必要的控制和COM preSS +切成更小的部分,剩下的视图状态后的数据视图状态。

您可以谷歌,并找到许多方法来COM preSS和削减视图状态的部分。

You can google and find many ways to compress and cut the view state in parts.

有些文章:

http://msdn.microsoft.com/en-us/magazine/ cc188774.aspx

如何削减它的教程:

how to cut it tutorial:
http://www.dotnetfunda.com/articles/article634-viewstate-patterns-in-aspnet-.aspx

如何COM preSS它
http://www.hanselman.com/blog/ZippingCom$p$pssingViewStateInASPNET.aspx
HTTP://www.$c$cproject.com/KB /viewstate/ViewStateCom$p$pssion.aspx
http://www.google.com/search?hl=en&safe=off&q=asp.net+com$p$pss+viewstate&aq=f&aqi=g1g-b2&aql=f&oq=

how to compress it
http://www.hanselman.com/blog/ZippingCompressingViewStateInASPNET.aspx
http://www.codeproject.com/KB/viewstate/ViewStateCompression.aspx
http://www.google.com/search?hl=en&safe=off&q=asp.net+compress+viewstate&aq=f&aqi=g1g-b2&aql=f&oq=

诗:在免费的文本框的这个演示页面您使用的视图状态是巨大的!它甚至从文本空的,想象有多大,视图状态可以,如果你实际拥有和文本中。不那么自由 - 的成本是巨大的视图状态

Ps:In this demo page of the free TextBox that you use, the viewstate is huge ! and its even empty from text, imagine how big the viewstate can be if you actual have and text inside. Not so free - the cost is the huge viewstate.

由于 Jeyara 说,在下面的意见,最终这是错误的大型文件后由防火墙托管服务器上的阻塞。

As Jeyara say on the comments below, final this was the error, a blocking of large post files by a firewall on the hosting server.

所以错误/超时都与大后回的数据和它的一个罕见的,但存在的问题。

So the error / timeout have to do with large post back data and its a rare but existing issue.

这篇关于ASP.Net后超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 05:12