Derik Whittaker

Syndication

News


Help, my MVC Ajax requests are not rendering and there is no exception being displayed

***** If there is any type of built in MVC support for helping find these issues please let me know *****

Ok, this may be common sense to everyone else on the net and if so… Oh Well.

Tonight I was working on the MVC3 rewrite of the Dimecasts.net website and after a bit of refactoring my search feature was not working….Well it was hitting the controller action just fine and returning the data out of the controller with NO issues.  However my search result div was not being updated dated correctly.

Fortunately for me I just happened to already have Fiddler up and running so I simply popped over to see what it had to say.  I immediately noticed that Fiddler was giving me a 500 error on my controller action result:

image

When I took a look at the response output I noticed the following:

image

In case you cannot read the above let me summarize for you.  Basically I had changed the response object I was returned back out of my controller but I did not change my partial view.

Once I changed my partial view to expect the correct data type as the result model everything was right as rain.

The moral of the story is 2 things

  1. Fiddler is your friend and WILL help you debug and diagnosis any errors you may have when doing anything http related
  2. When doing some refactoring remember to make the correct changes to your razor views or you may not get the results you expected.

Till next time,


Posted 10-10-2011 5:38 PM by Derik Whittaker
Filed under: , ,

[Advertisement]

Comments

Jason Barile wrote re: Help, my MVC Ajax requests are not rendering and there is no exception being displayed
on 10-13-2011 11:57 AM

Don't forget about the F12 dev toolbar in IE9.  It now includes a network inspector feature that will give you the same insights to your http traffic problems.  I've found it super helpful in debugging AJAX calls for one.

Jason Barile wrote re: Help, my MVC Ajax requests are not rendering and there is no exception being displayed
on 10-13-2011 11:59 AM

Don't forget about the F12 dev toolbar in IE9.  It now has a network inspector that will let you see the same type of http traffic.  I've found is super helpful in debugging AJAX issues for example.

Dave Schinkel wrote re: Help, my MVC Ajax requests are not rendering and there is no exception being displayed
on 10-18-2011 11:55 PM

why Fiddler and not Firebug?  You can get the same info...and FB in my personal opinion is better and has much more to offer on client-side Request/Response analysis.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)