ASP.NET 4 UpdatePanel and IIS7 Problem - visual-studio-2010

I have an ASP.NET 4 webpage that contains an update panel which just allows me to add a few items to a drop down list without reloading the entire page.
The page works fine on the Visual Studio 2010 ASP.NET Development Server, performs the Async call and the page is properly laid out. However, when I deploy the page to IIS7, the Async call no longer works (the page is completely reloaded) and the layout of some items on the page is incorrect.
I used Fiddler to look at what's happening and it looks like there are 404's when the page tries to access ScriptResource.axd, with everything else working correctly. I think that has to do with the Javascript required for the call but I'm not sure how to fix it. Any suggestions?

I had the same issue. After reading, this and this2 I checked the ISAPI handlers definition in the root site of my IIS, but it looked fine, so I kept struggling some more.
Finally fixed it by realizing the ISAPI Handlers definition had been modified at the site level, and wasnt inheriting the same definitions as in the root site. It was fixed selecting my site in IIS Manager, going to the "Handler Mappings" section, and then clicking in "Revert To Inherited".

Related

Problem with "Edit and Continue" in a ASP.NET core mixed Razor Pages and MVC app

I'm trying to update an old webpage that I had developed using MVC. Now I'm adding Razor Pages, but then Edit and Continue won't work anymore.
I can isolate/reproduce the problem in a minimal context. It seems to occur when there are files both in Pages and in Views, e.g. _ViewStart.cshtml.
Here is how to reproduce:
Create an ASP.NET Core Web App, .NET 5.0, No Authentication, no HTTPs, no Docker, enable Razor runtime compilation
Place a breakpoint in IndexModel constructor
Run App
When hitting the breakpoint, edit the code (just add a semicolon in the ctor), continue: code will compile and continue
Add new folder "Views"
Copy _ViewStart.cshtml from Pages to Views
Run App again
When hitting the breakpoint, edit the code (just add a semicolon in the ctor), continue, get message: "Edits were made to the code which cannot be applied while debugging"
I could probably work around the issue, but I'd rather try to understand why this happens.
This also happens when I add the Identity package and try to customize the pages, in which case I also need a double _ViewStart.cshtml...
Any ideas?

Visual Studio new files have sub application relative urls

I have a typical solution with multiple projects.
In IIS I have configured a new website with which to access my development area. Underneath this I have another sub application, pointing back to the same place. (This allows me to have mysite.com and mysite.com/au/)
This all works fine.
The problem I have now, when I create a new file (say an aspx page) and specify a master page (probably other scenarios as well) the relative link that is created is ~/au/masterpage.master, not ~/masterpage.master as one would expect.
As well as not loading in the CPH's of the master page (hugely annoying) this also breaks my page. So my question: Has anyone had this happen to them and how did they solve it?
EDIT
I found that if I removed the sub application and restarted VS, next time I created a file it worked as expected (without the /au/). However, it would be nice if I could leave the sub application in place.

Weird jump to top of page behavior with MarkdownDeep

I am playing with MarkdownDeep .Net/Javascipt Edition for an MVC 3 application. Added it via NuGet. The page renders Markdown sharp box just fine. However I get a weird jump to top of page behavior if any of the icons on the markdown sharp toolbar are clicked. I googled and didn't find anyone else having this issue.
Any thoughts? The script file and css are being loaded properly - no errors in Chrome console.
Have you checked that the microsoft ajax scripts are included in the page and that the web.config file is configured to use it? Try something simple like a ajax.beginform to see if it posts the page or if it calls an ajax post.

What about task lists and other web parts in Sharepoint?

I have the Ajax working on a custom web part written in Visual Studio and it works fine.
Question: I created a task list on the site and added it as a web part to the default page.
I would like that web part (task list) to also refresh asynchronously. I have opened it in Sharepoint designer, but I really don't know how to apply Ajax to it. Any suggestions, pointers towards blogs, demos, etc would be really appreciated.
I'm going to have to add a refresh button so it has a child control to trigger the refresh, which is fine. I just don't know how to get started.
Thanks.

Why doesn't Visual Studio always render my page correctly when debugging locally in fire fox 2.0x?

When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any solutions?
I want to add that this is happening in fire fox 3.x to me as well. I add my javascript to the pages dynamically and this might be part of the issue. This is when I am working locally with Visual Studio.
Update: This does happen in IE but it happens much more often in Fire Fox. The issue seems to be only javascript and CSS files not loading. For example I get jQuery is not defined, $ is not defined etc. I don't think I have local IIS to test this on but from the server it always works perfectly. Fire Bug shows all my css and javascript files to be requested and received.
This could be a problem with IPv6 and DNS of the Firefox browser. This issue is known to slow down Firefox on localhost:SOMEPORT. The effect would be that some external files won't load (css, js etc.) resulting in a partially rendered page.
You can solve this issue by simply deactivating IPv6 in Firefox:
Insert about:config in the Firefox address bar
Set network.dns.disableIPv6 to true or alternatively add localhost to network.dns.ipv4OnlyDomains
A different way to fix this issue, is to a remove the ipv6 address from your hosts file this way: open the file
C:\Windows\System32\drivers\etc\hosts
(with administrator privileges) and remove (or comment out #):
:: localhost
Make sure that you narrow the scope of the problem. Does the problem just happen when debugging from VS or does it also happen with local IIS? With server-based IIS? Does it happen to other developers in your company? Is it really just FireFox or does it happen to Chrome, Opera, IE, etc?
Assuming that you've already worked that all out, I would suggest installing a FireFox plug-in called "Tamper Data". Open that and refresh the page. You'll see a record of every connection from the browser to the server (for each html file, image, css file, etc). Look to see if any of the them are very slow or not completing (perhaps one of those files is taking a long time and FF is waiting for it to finish before loading other important files).
Assuming that all of the files correctly loads, you should consider checking that the syntax is valid (maybe there is some unclosed tag or quotation mark that is causing FF confusion). I use a plugin called "Web Developer", but there are a lot of other options out there.
You could also use a plugin called FireBug to view the HTML behind various parts of the page to see if there are any noticeable problems. You start FireBug, go to the HTML tab, click Inpsect, and move your mouse over something on the page, and it will show you the HTML behind it.
One thing to do would be to check the source of the page(s) in question. My guess would be that the local server that VS runs is not giving you the entire source of the page. One way to verify this would be to run exactly the same code in the debug environment, as well as from a "real" server like IIS 6. If the same behavior is seen on loading the page from both servers, as well as insuring that the full page source is being recieved by the browser(s), then it is a bug in Firefox and should be reported. This is especially true if other browsers, ie. IE, Chrome, Safari, Opera, render the page fully.
Are you comparing what you see in Firefox to what is displayed in the Visual Studio designer? If this is the case, then they are using 2 different methods to render the html and may not display the same.
Anything further on this folks?
I have examined the traffic using Firebug and it appears that when veiwing the response from the request for a style sheet, the response is just blank. After refreshing (sometimes multiple times) the age displays correctly and the response information contains the style sheet. I have not seen this in any other browser and it only occurs when viewing the app from Visual Studio.
2! Recently i had the same problem. Im using MVC 1.0 and I added a new stylesheet into Views/Share folder. And when i run the project, the page didnt render along with the css. If your web project is a MVC one so try put the css file into the Content folder.
Hope this help.
HaiVu.Doan.
In case anyone else finds this with newer versions of Visual Studio, I have to run VS as Administrator. This is something I keep forgetting to do, but once I right clicked on Run as Administrator when opening VS, the problem went away.
Initial problem, I could not get CSS to render when running a project from VS 2012 using Firefox as the browser. (IE worked just fine, btw.) The content would be there, but no CSS. This was the first post I found when I typed in my question.

Resources