Webforms showing source code instead of rendering - asp.net

I'm working on a legacy project that used Webforms. There is now a bug occurring on our production servers where a few of the web pages will show source code. I cannot replicate this on our test servers or by debugging it.
If it shows source code it will persistabtly show source code until the in-private/incognito window is closed and a new one is open.
It will occur about 50% of the time (out of 100 recorded tries it failed exactly 50).
This is a screenshots of some of the source code I'm seeing:
and
A commonality between the pages that break are that it uses AjaxControlToolkit, however there are other pages that use AjaxControlToolkit that aren't breaking.
Additionally, when I try to hit these pages they don't hit the page at all. If I'm not signed in they should redirect to the login page and they don't even do that.

Related

How do I open a specific .aspx page from Visual Studios in browser

When I compile, I want the browser to go to that page instead of going to the log in page, when I set it as Startup page, VS starts not responding and freezes the screen. This is a very simple question but I cannot find the answer to it.
For an .aspx page, many possible reasons could cause "VS starts not responding and freezes the screen". I would suggest that you check your aspx file and the code behind file to see if there is any database connection and it loads large amount of data. Any pre-initiate program error could also bring page load failure. You may try move your GUI code to a separate html file and then view it in a browser to see what happens.

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 =]

MVC Application is hanging after the html has been rendered

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.

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.

Resources