Invalid page response when I hit multiple times - asp.net-mvc

I recieve an image instead of page contents when i hit a page multiple times.Application is devloped in MVC and running under IIS 7.5.

You should check your hosts file under "c:\Windows\System32\drivers\"
If your site is using CDN then often the request on page gets pending

Related

Access to a PDF File in a http with dinamyc variables

Hello everyone (sorry for bad English), i'm getting crazy with this problem... i'm working on a project with NiFi expecting to download PDF files from a public Goverment page. The main problem it's that the page you request in a web browser shows the correct page like this
Asking the same page in NiFi (also testing in postman) shows that the session has expire, then looking at the HTTPS POST with the development tools in chrome i notice that there are multiple headers that contain dynamic variables
Is there any form to replicate web browser behaviour on NiFi?

IIS hosted app triggers run time error when url contains a "-"

I have an VS2017 AspNet MVC 5 app hosted on a 2016 Server and IIS. Each client has its own website with its own copy of the web app. Using godaddy.com I forward (with keep mask checked) the client domain to the sub-domain in the IIS and everything has been working fine for years. The client can access the web app and see its domain name in the browser url.
Example: myclientdomain.com forward with mask to myclientdomain.mycompanydomain.com but shows in the browser as myclientdomain.com
Now, I have this new client whose domain is newclient-domain.com (It has a dash) and it was forwarded exactly like the others, however, after the page loads, if the user clicks the only button in the page, it triggers a runtime error saying:
"The required anti-forgery cookie "__RequestVerificationToken" is not present.]"
Since all the others don't have this error, I am inclined to think it is the dash in the domain name. Am I right? Is there any solution other than removing the dash from the domain name?

HTTP Error 401.0 IIS 7.5 MVC Application on remote access only

I have MVC application with Forms authentication, that runs on IIS 7.5. It runs OK in debug enviroment and also after deployment on serwer but ONLY when is called from the server directly (http://127.0.0.1). When I try to run it from the remote computer the logon screen is not displayed, I recievie HTTP Error 401.0 - Unauthorized You do not have permission to view this directory or page. Similar application with the same logon (forms) runs OK on the same server.
After three days of googling and strugling it turned out that the view with logon page contained the partial wiew with standard page footer and there was #Html.RenderAction("...","..") call in this footer. The called action contained [Authorize] attribute. After wrapping this call with if(Request.IsAuthenticated) everything works OK.
Quite strange - when the page was called by localhost addres, some part of footer just did not show without making this error.
To sum up - in case of 401.0 after deployment the problem could be in application's view.

ActiveX cannot screen capture a page that is hosted on the same server

I have an app that takes a screenshot of web pages and creates a resized image. The app is basically loading a web page that calls an ActiveX to load a web page using IE resources and take the screenshot. This app has been running on a Windows Server 2003 without any problems for a couple of years.
But now that I have upgraded the server to Windows Server 2008, the screenshot action is timing out. From tests I can see that it successfully takes a screenshot of any web page hosted on the Internet... except pages hosted on the same server.
Whenever it tries to capture a page loaded on a site hosted on the same server as the app, it times out. ESC is disabled and it seems that all other permissions are ok, ie: it works for remote pages but for home pages.
Any ideas as to what can be causing this and how to fix it?
After further testing I have narrowed down the reason for failure being due to the page being popluated from a MS-SQL database record on the same server as the one taking the screenshot. The same page generated on a remote server captures ok. I have further established that the error is not peculiar to the ACASystems DLL because it also affects another DLL for creating MHT files from web pages. This DLL (Chilkat.MHT) also uses IE to load and assemble the web page on the fly and then saves it as a.mht file.
So the problem is more related to IE assembling web pages from MS-SQL while running ActiveX. But to resolve this enigma?
Maybe a routing issue (DNS/hostfile..) ? Does the page loads on local session with IE ?
There is no solution for this without editing the ActiveX code. Since the DLLs in question are third party resources, such editing is not possible.
After testing 3 different ActiveX that load a web page that either take a screenshot or save as .mht, it was found that they all failed when loading a page that was querying SQL on the same server. After contacting the 3 DLL developers we were informed by all of them that their ActiveX has no impact on MS-SQL.
Unfortunately, our tests tell us otherwise. At this stage we are left guessing however this article about in-process vs out-process execution may be related.
The workaround for us to solve this problem was to assemble the page to be captured from request queries passed to the page rather than populate from SQL queries. This alternate works perfectly.

asp.net mvc - site works fine locally but not after deployment

i have an asp.net mvc website. http:/mywebsite.com (just for this example)
I have been testing this asp.net mvc website locally on my machine and everything works fine on my local machine during testing. When i deploy to my web server
when i bring up http://mywebsite.com it goes to HomeController and load the view Views/Home/Index.aspx (which is perfect). So the main default page is fine.
The issue is, if i click any other other links (again that all seem to work fine locally) i get the following error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
* Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
* If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
* Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
some examples would be:
http:/mywebsite.com\Photos
http:/mywebsite.com\Links
there definitely are controllers and views setup for this (or it wouldn't work locally).
does anyone have any idea how this might work fine locally but somehow on the webserver it doesn't
Are you running the site on II7 in integrated mode? If not, you need to add a wildcard handler so that all URLs get mapped to your application. See Phil Haack's blog post on running ASP.NET MVC ON IIS 6.
Something else to watch out for. I had a static website - deployed on IIS 7.5. Added some MVC Controllers to handle some simple server side apps and then re-deployed it. I didn't copy the web.config file, because I wrongly assumed that everything that was needed was in the one that was automatically created by the server.
You must copy the web.config up as well.

Resources