We have a aspx page on our iis7 server, which fails to work on production but works fine on development - asp.net

Basically we have this aspx script generated by another company, which we need to run, we normally just use coldfusion, for our company.
However this app is an aspx.
We have both a development and production server, it works flawlessly on our dev server, but it fails to work at all in the production server.
It uses a javascript function called _doPostBack.
I have compared the aspx files on dev/prod line by line, and they are 100% identical.
So I need some ideas what iis7 setting to change to allow this to work. Since we didn't do anything special to make it work on our development server.
Our Prodution server is sql2008, iis7, win 2008 i believe.
Our Development server is sql 2005 express, iis7, vista business edition.
Any suggestions or tips we can do?
And in firebug it generates no javascript errors of any code, but the navigation links do nothing.
The page itself displays, on the left is a list of links, which if clicked on, should change the content on the right/main content area.
This works fine on dev, it doesn't work at all on production. It does display the page, show's no javascript errors, but the navigation links do not work.
There is no external javascript file, so it must be something in iis.
Thanks

I would consider reinstalling asp.net on the box that isn't working. Can be done from command line using aspnet_regiis -i
http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
Other than that I have no idea. Sounds like a config issue to me though..

In the IIS settings, make sure the ASP.NET System Services is running and verify that ASP.NET exists in the Role Services. Also check the Application Pools and in the Advanced Settings, you can check the .Net framework version.
What happens if you try to acccess a page you create called test.aspx with plain text?

You can try running the page locally on the production server, sometimes things will work locally but not remotely if it's an IIS issue.
Have you verified that the appropriate .Net framework is installed on the machine and that the page resides in an application in IIS?

Using IE8, press F12 to bring up the developer tools. Inside the tools you can examine the various scripts that are (or will be) running, and start debugging. Start the debugger and set a breakpoint where the _doPostBack function is being called (or inside the function itself) and see what is actually happening.
Also, you may want to fire up Fiddler2 and compare the HTTP requests between your development and production servers. It is entirely possible that something else isn't returning as expected (like a call to WebResource.axd) in production that works fine in dev.

Related

ASP pages do not load

First off, I'm not a web developer, so I might be asking the question in the wrong place. Unfortunately, I've tried searching regarding my problem but most of the issues I see are web-developer server side issues, so I'm runnig out of places to turn.
The problem: I'm trying to navigate a website, and eventually it decides to try running a ".asp" page. However, my browser just hangs (attempted Firefox and IE11), until it eventually times out. However, when I've run the same website on other machines (such as my phone), those pages load flawlessly. The fact that it's browser independent seems to suggest it's something with my local machine (Win7). I've ensured the IIS feature is turned on and the process is running, but still nothing.
The only other evidence I have is while searching for ASP tutorials, there was an example designed to show the current date/time which didn't work. The rest of the page which was straight HTML was then fine. I'm not sure if it's possible that some native binary for a scripting language isn't loading, but I'm not sure how I can debug that.
To summarise, my questions are as follows:
What could stop an ASP page being loaded on a client machine?
What can I do to ensure the right dependencies are present on a client machine such that it can load ASP pages?
To note, I'm not aware of anything I've installed which would affect this. The only code related program on my PC is Visual C++ Express 2013, but I'm not sure what that would do. .Net 4.5 is installed but I don't know how to tell what script the asp page is attempting to execute.
* What could stop an ASP page being loaded on a client machine?
IIS?
IIS is the one responsible for parsing asp code.
IIS takes your ASP code, and then, transforms it into html code, then sends it to the client.
There might be an issue with your windows 7 computer, but there is nothing related to ASP.
* What can I do to ensure the right dependencies are present on a client machine such that it can load ASP pages?
There are no such dependencies. Your client makes a call to a server, which returns html code.

Changes to razor view not showing

I have made some changes to a view in my ASP.NET MVC3 application, but the changes I have made are not showing up when I test/debug the site within the browser. The changes I am making are simple text amendments to the markup.
I am using the Visual Studio development server for testing the application.
The odd thing is, I have tried publishing these changes to IIS and the changes I have made to the view are working when I test the application using the IIS server.
It is only when testing in the Visual Studio environment that this seems to happen.
Thanks,
A common problem i've run into is when you are not using IE and you close the debug session, but not your browser.
This means that the "IIS/development server" is still running in your system tray, but it is running on the old compiled code, if you hit ctrl + shift + b, you build your entire solution and re-publish your code to your development server. this allows you to hit refresh (F5) in your browser and the changes you've made to the razor view should now be reflected in your browser.
Are you using IE? Maybe deleting the cache or using another browser should work? I've had a lot of problems with that :D
Solution is to use IIS Express. For some reason, the VS development server doesn't recognise changes to code behind - nothing to do with caching on the browser.
However the location of the source code as suggested in other answers is important - it works for me using the c:\windows folder or c:\users\DefaultAppPool - apparently it has something to do with security to ensure.
Only applications running under the 'DefaultAppPool' identity are permitted under IIS. So, for anyone using a VM and mapping the host OS code folder you won't be able to rectify this unless you copy to a local folder in the c:\users\DefaultAppPool folder.
You may also now have difficulties accessing the SQL server database established for the Membership Provider under ASP.NET. For more details on how to fix that, I've posted on my blog.

Am running the web allication using asp.net.am getting this error

HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /webctrl_client/1_0/treeimages/Rminus.gif
I had this problem for a simple reason. Make sure you compile your site before deploying it. I had some pages that were compiled and some pages that were not compiled. And because I was testing on a Windows Server 2008 box, not a Windows 7 box.
It took me so long to figure out because when I tried viewing these pages on the application server (Windows Server 2008), it wouldn't let me view a non secure page (http protocol), because of Internet Explorer's security settings. I only had a binding for port 80 when testing on a browser on the server box. So I couldn't even see the aspx page that was compiled, let alone the aspx pages that were not compiled. A plain HTML page was visible on both boxes however, on the same site--that part was interesting. So that told me IIS was running fine. When I viewed the pages on another machine (running Windows 7) on that network, the compiled aspx page showed up fine because it was compiled. And the non-compiled pages did not.
Here are other possible issues:
(use correct version of .NET framework for commands below)
1.) Have you installed the .NET framework?
2.) Make sure ASP.NET 4.0 is registered. Run these commands to verify.
"%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -lv
"%systemroot%\system32\inetsrv\appcmd.exe" list apppool /managedRuntimeVersion:v4.0
"%systemroot%\system32\inetsrv\appcmd.exe" list config -section:system.webServer/isapiFilters
If not, run this:
"%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis" -i -enable
3.) Make sure the ISAPI filters are turned on for the version you are using. Click server (not the site) in IIS 7. Then go to "Isapi Filters". Allow the ones you need.
4.) Make sure your application pool is running in the version of your compiled source code of your ASP.NET pages. Go to Application Pools in IIS, then right click the application pool for your site, and choose Advanced. Change the version to either 2.0 or 4.0. Make sure it's also 32 bit if you compiled your app as 32 bit.
... when reading forums those are the 4 solutions I came across most frequently. Mine was a bit simple, but confused me for hours because I hadn't installed the SSL certificate yet.

ASP .NET Development Server not serving everything all the time

I'm using Visual Studio 2005 on a Windows XP SP3 machine and recently have come accross a some what strange issue.
I have a C# and ASP.NET project that runs fine when on the team test server and using IIS locally on my own machine. However, running it using the in-built Visual Studio ASP.NET Development server it doesn't seem to serve all the images/scripts/css files all of the time. When I load a page one time images A, B and C will be missing and I may get a system (sub-package) error however loading it again all those images will be there and the sub-package will work but a CSS, a script or any other image file may be missing.
The Windows event application log seems to show occasionally the missing files will be logged but this isn't consistent either.
It happens to me all the time; I think the reason is that the ASP.NET Develoment server is not a very good HTTP server, and when receiveing too many requests, it drops some ones.
Since it is also very very slow, I configured vs2008 (you can do that with vs2005, of course) to use ASP.NET for debugging; it works far better that way.
To do that:
Project -> properties -> Web (last tab) -> Server. There are three alternatives: Use Visual Studio Development Server; Use local Web IIS; Use custom Web server. Choose the second. (not sure about the exact english names: I have the Italian version of VS).
Check the page in Firefox/Firebug or with IE8 and see if the paths to the files/scripts/images is correct or not. A common problem when switching between the local dev webserver and IIS hosted pages is that the paths may not resolve the same. You can fix this sometimes by using the "~" character before a path in the asp code.

ASP.NET Development Webserver Starts but does not Serve Anything

I created a Virtual Application in IIS 7 to host my app so I could test it on other machines on the local network, since the development web server will not respond to requests from machines other than the local machine. I had to allow IIS to login as me to get into My Documents, and enabled ASP.NET impersonation through the IIS. That worked fine, but...
Now the ASP.NET Development Webserver won't serve anything at all. I hit debug in VS2008, the dev webserver starts up seemingly fine, but then the IDE launches Chrome and the browser just sits there twiddling its thumbs. It never fails, but never loads. Nothing.
There are no errors from ASP.NET Development Webserver or Visual Studio or Chrome that I can find. I even looked in the Event Log. Nothing.
What did I just stupidly do?
I haven't got Chrome installed at the moment so i can't confirm for sure before i answer this, but IIRC i have seen this before and the VS debugger cannot correctly launch Chrome and serve it pages from Cassini (the VS development webserver).
The way i got round this previously is to just create a virtual directory in the local (dev machine) instance of IIS, and point it to the folder containing your web project. Then you can use Chrome to browse it just like a normal web site. You can then manually attach the VS debugger to the right worker process.
Alternatively, you could start up the debugger as you are now, and when Chrome sits there, you could manually enter the url for the page you want to start with (it will be http://localhost:<some port>/default.aspx or similar). VS won't be able to debug the script in the page, but it should still debug the compiled code just fine (like it does for Firefox).
Holy crap, I know what it was. When I changed the IIS settings to have ASP.NET impersonate me to get into the My Documents folder, it modified the web.config file. Now you're probably thinking, well duh, of course it did. I honestly thought that IIS 7 had some new way of dealing with impersonation other than the web.config setting. Turns out it's just built into the MMC snap-in to manage it now, but it does it in the same way.
Once I reverted back to the original version of the web.config file, ASP.NET Development Server happily worked exactly as intended again. I suppose ASP.NET Development Server craps out if there are impersonation settings in the web.config.

Resources