Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am making an Ajax call to ASP.NET MVC endpoint. The url is something like this (Last parameter is null):

/employee/GetAllEmp/connID/Sale Dept/Month/Year/week/null?_dc=1371101563256

Server side:

 public ActionResult GetAllEmp(string connID, string deptName, string month, string year, string week, string data)

When my application send request through IE, the endpoint at the server side is not called but when same request is being made through fire fox, system is able to call correct method.

What could be the reason? I googled around but could not find any answer :(

Please provide your suggestion.

Thank you

share|improve this question

1 Answer

up vote 1 down vote accepted

Based on what parameters your action method expects then /null will be parsed as a string literal rather than true null.

If this data is empty you should skip it completely and make your route accept an optional parameter

share|improve this answer
This makes sense but why I am able to call the correct endpoint when i make request through firefox? – Brown_Dynamite Jun 13 at 6:12
How about Chrome? What result do you get with that? – Stokedout Jun 13 at 9:15
You may want to step through your ajax logic using IE's Developer tools and determine what endpoint address is requested. Then compare this to Firefox using Firebug. – Stokedout Jun 13 at 9:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.