jQuery ajax Data Sent to Controller are Empty only in IE
- by saman gholami
This is my jQuery code :
$.ajax({
url: "/Ajax/GetConcertTime",
type: "POST",
cache: false,
data: { concertID: concertID.replace("ct", ""), date: selectedDateValue },
success: function (dataFromServer) {
//some codes ...
},
error: function (a, b, c) {
alert(c);
}
});
And this is my controller code for catching parameters :
[HttpPost]
public ActionResult GetConcertTime(string concertId, string date)
{
int cid = Convert.ToInt32(concertId);
try
{
MelliConcertEntities db = new MelliConcertEntities();
var lst = (from x in db.Showtimes
where x.Concert.ID == cid
&& x.ShowtimeDate.Equals(date)
&& x.IsActive == true
select x.ShowtimeTime).Distinct().ToList();
JavaScriptSerializer js = new JavaScriptSerializer();
return Content(js.Serialize(lst));
}
catch (Exception ex)
{
return Content(ex.Message);
}
}
After debugging i know the parameters in Controller (concertId and date) are empty when i useing IE browser.but in other browser it's work properly.
What should i do for this issue?