2

I have spent about 7 hours trying to figure this out but gotten nowhere.

This is how my fiddler trace looks like alt text

I have two routes that look like below that are registered for this page.

[route name="DummyResultsWithMarketStateNames" url="DummyResults/state-{statename}/market-{marketname}/page-{page}/{action}"
   controller="DummyResults" action="Show"/]


[route name="DummyResultsWithMarketId" url="DummyResults/market-{marketid}/page-{page}/{action}"
      controller="DummyResults" action="Show"/]

For this url, the first route matches and it goes to the right action. However, the client is sending in another request a second later in which it removes the last parameter 'page-1' and replaces it with 'none'. I've traced for XHR's and there are none. I'm not sure if this is an issue with the MVC framework itself but how would that translate as a request from the client?!!! Also, I'm getting different behavior with different browsers (IE trace above). Anyone encountered such strange behavior? I'd be happy to provide more info if you'd like.

UPDATE:

I setup the site on IIS and eliminated all image, css or script requests. I still end up with multiple requests. The original dummyresults page seems to be working now after I removed the .htc's. However, I have another page (screenshot below) that is not 'co-operating'. Should I add Ignoreroutes for certain extensions? This is driving me nuts!!! Pardon the 'bleep' on the image (IP reasons). PS: I setup another site for serving up all static resources.

alt text

Nate
  • 30,286
  • 23
  • 113
  • 184
Praveen
  • 772
  • 2
  • 9
  • 25
  • 1
    (1) Since I see a request for a .gif file I assume you are using the VS Web Server rather than IIS, right? Try with IIS instead you might be getting more requests that you expect because IIS would typically handle some of these request for your (like the one for .gif files). – Hector Correa Dec 22 '10 at 14:05
  • 1
    (2) I think the root of the problem is the way some of the resources on the page (e.g. an image, a partial view) is being loaded might result in a URL like the one that you are seeing with the market-austin/none request. Try removing elements of the page one by one and see which one causes this. This would also explain why it behaves different on different browsers as each browsers uses their own engine to request/load elements of the page from the server. – Hector Correa Dec 22 '10 at 14:05
  • Thanks Hector for your insight. Please see my update above. – Praveen Dec 22 '10 at 18:21

1 Answers1

1

Q: Should I add Ignoreroutes for certain extensions? A: Of course! By default the WCF extension "*.svc" is ignored. The first thing I add on a ne page is for instance the ignore rule for the favicon.ico.

RouteTable.Routes.IgnoreRoute("*.svc");
RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
RouteTable.Routes.IgnoreRoute("favicon.ico");
Daniel Fisher lennybacon
  • 3,865
  • 1
  • 30
  • 38