MVC Application is hanging after the html has been rendered - asp.net

I have an odd problem and would appreciate any help you can provide.
I have a .NET 4.5 MVC application that I am developing using my local IIS server.
The view that is causing the issue is a very large table that has dynamic columns as well as rows. I'm passing it a view model which includes a list for filtering.
Everything works perfectly here. I load the page, everything is rendered as it should, no problem.
The issue occurs when I try to do a post to apply filtering. The site just hangs, but if I hit 'stop' on the browser, the page will then display exactly how it should, with filtering applied. When I check Task Manager, the IIS Worker Process is sitting between 25-30% and I have to kill it to get normal performance back.
I set a breakpoint just inside the closing body and html tags which is hit on the postback, so the html is all being rendered.
Does anyone know what could cause the server to hang up after the html as been rendered? I find this very odd since I can just hit stop in firefox and the page will be displayed perfectly.

Related

Launching SSRS Report causes browser to hang

I have a customer portal with a few reports in it. When I click a report link on the parent page to view a report, a new window opens (window.open) which contains an ASPX page, containing a reportviewer control.
The report runs (less than 30 seconds):
But then something strange occurs.
If I remain on the parent page, 15 minutes later, the browser is unresponsive. I cannot browse to any other pages on the site, I need to close and reopen the browser to continue. If I do NOT choose a report, 15 minutes later the browser is fine.
I've used network tools to see what the network calls looks like, and all I get is that a call was initiated.. nothing indicating a hung HTTP call, etc. It just.. stops.. If i browse the site immediately after running the report, it's fine! But if I hang out on the parent page after running the report (even after closing the child report window) I get the unresponsiveness.
There is a limited set of compatible browsers, especially on older versions of SQL Server SSRS. I would always recommend IE, which it looks like you are not using?
Here's the compatibility info (for SQL 2016, there's a version selector at the top of the page):
https://msdn.microsoft.com/en-us/library/ms156511.aspx#bkmk_reportviewer
Not really the solution, but finally found a more permanent fix for this. I developed a separate website that hosts my ReportViewerControl. I then developed a web form that loads with a meta refresh, after 3 seconds the page will "refresh" and redirect to my secondary ReportViewerControl website.
Something "goofy" was happening here, the session was getting locked up, almost like the more complex the report, the longer the session was locked up, the more of a chance the browser hanging. Something with the meta refresh and the secondary website causes the session to be completely disconnected (I think???)
There's probably no other person in the world that will have this issue, but if it does, at least others know my story =]

Strange double postback in asp.net because of IIS setting

I have the follow problem. There is an asp.net application running on 5 different servers. On most of them everything is normal. Each page is doing single postback before rendering the result. On only one server we faced very strange problem. The page is rendered with the single post back, but after that, there is another second postback call even the html result is already displayed in the browser. I believe it's because of IIS configuration, but it's my first time facing such thing. Please advice if you have any idea. Always there is a solution to reinstall the fifth server but we won't know why.
Unfortunately the code is the same on all of the servers. Also they are working at same platform (windows server 2008 r2 + IIS 7.5). It could not be because of bad html syntax. The other servers work perfect. The fifth server is still not re-installed, but may be this will be the solution. We've already spent a lot of time searching for the answer, but it looks as strange as it is. I'm not sure if I successfully described it. The additional post back is not a real post back, because the html is rendered, the page is displayed, but the debugger goes one more time through the code. Otherwise nothing else happens. I wonder why the debugger will go again through the code as it won't change anything on the client side. Because on the browser side it seems as the request is finished, the result is received and everything displayed on the page. If you're not debugging it with VS, you won't find any difference - all the 5 servers looks as working equal. If the problem is not a setting in the IIS, it could be a setting in the VS, but which one and why???

ASP.NET 2.0 website white screen of death

I am encountering a strange issue which is only affecting several users from an over 7000 user-base. Having searched the web for several hours to no avail, I'm hoping someone here can help!
I have an ASP.NET 2.0 website and when certain users try to access the home page (Default.aspx) they receive a white screen with no content loaded. This issue is occurring both in production environment and if I run the solution against a copy of production data. So I am able to replicate the exact same issue when I pseudo the problematic users.
When debugging the application in VS2005 and set a breakpoint in the code behind in the Default.aspx, the breakpoints are fired/hit so I know the request is working. The problem seems to be once the server has finished serving the request, the response back to the client/browser is empty.
Here's another strange thing I've noticed. If I alter the HTML in Default.aspx by adding a new white line or whitespace, the page will load fine for the same set of users. I thought I had resolved the issue with this fix but unfortunately the white screen issue just manifests itself once again.
Within Default.aspx, there's some AJAX requests using jQuery .load function but this can't be the issue because this functionality exists for every user of the site. The only variable is the amount of content returned within this request can vary depending on the user. But why would it resolve itself when I put a whitespace or whiteline in the page and then manifest itself hours later?
Another thing to note is it's only Default.aspx that is encountering this issue. If I browse to another page by typing in a page in the address bar, the page is served OK.
Hope someone can point me in the right direction on how I can debug or even resolve the issue.
It sounds like your ajax is the cause but without seeing some code, it's difficult to know why.
It could be a timeout, or an error that is preventing the ajax from completing it's function.
You need to use a tool like Charles or Fiddler to debug what is happening whilst the page loads whilst logged in as these users. In a nutshell, a tool like Charles will display all the detail surrounding requests made and responses served to the browser, including any failed responses.
I think it has to do with http headers, caching or encoding. But I cannot tell more without code.
Is output caching enabled for this page?
Can you give us the raw http headers for both the request and response?
If a white screen appears, will it be fixed by pressing ctrl+f5?

Most elements of an ASP.NET page are not rendered after random idle time

We have been trying to figure this one out for a while now, without any luck.
The symptoms are as follows:
After some idle time of a specific ASP.NET 2.0 application (can be from several hours to days), one of the pages in my application stops working.
When viewing the source of the page I see many elements missing, elements that are usually there, such as: reference to WebResource.axd, the __doPostBack() function, all of the UserControls and more.
A reference to ScriptResource.axd, and the __VIEWSTATE are there.
After recycling the app pool, the application starts working correctly again and everything renders well.
This only happens on a specific server, when deploying the same application on a different server, this error does not occur.
The page that the error occurs on has only one UserControl which is not rendered when the error occurs. Nothing special happens when this page is loaded.
We tried doing periodic client refreshes, but that did not help either.
Thanks in advance.
It was a caching issue. There was a part in the code that hid specific controls when the cache was invalid. That explains the missing code parts.
I am still not sure why the cache was invalid on that specific server.

Weird IE Refresh Problem on ASP.Net 3.5 site

I have a very unusual problem that actually took me quite some time to even locate the root cause. I have an ASP.Net 3.5 web application running on Windows Server 2003. I was getting reports from users that said every so often the application would refresh on its own, without user interaction. This was unusual as I have not coded any client side refreshes. After much troubleshooting I narrowed this down to an issue with Internet Explorer (both 7 & 8). FF, Chrome, and Opera do not exhibit this behavior.
Basically, this only happens the first time a user visits the site on a new instance of IE (either a new window or new tab). If the user goes to any page within the site, and then does not interact with the site again, after 6 minutes the browser refreshes! After that refresh, as long as it is the same instance of IE, no matter what page on the site you visit, and no matter how long you let it sit, you never see the refresh again. This has really baffled me, and has become a major problem as this app has data entry forms that take longer than 6 minutes to complete. Unfortunately, if the user gets caught by this refresh bug, anything they entered is lost because of the post.
I need help!! Any advice or options to try would be greatly appreciated. Thanks!
(no, I cannot require them to use a better browser as this is a corporate environment with restrictions set to use IE for non-technical users)
It's a stretch, but maybe you have a 3rd party component that's adding a meta refresh tag only for IE (see http://www.w3schools.com/tags/att_meta_http_equiv.asp (refresh value)). Or maybe there is client-side code generated somewhere only in the case of IE that puts a location.reload() or location.href = someLocation a client-side script block in your markup.
Have you compared the HTML markup in IE and and FireFox? Are they the same? That's where I would start. If they end up being the same, look at script references and search for location.reload() or location.href.
And actually maybe before that, run IE without Add Ons enabled and see if it refreshes. To run without addons, do this at the command line, "C:\Program Files\Internet Explorer\iexplore.exe" -extoff

Resources