0

Iam trying to pass model of data from mvc controller to page from a ajax post call. I get data successfullt. But the dates contain in the model are converted like "/Date(1455647400000)/". How can i convert it into "wed feb 03 2013". please help me.

My code:

public JsonResult getHeaderData(string code)
{
    if (code != "")
    {
        var userData = (IdentityModel)(Session["DATA"]);
        decimal doc_no = Convert.ToDecimal(code);
        var data = _transactionHeaderManager.GetHeaderDataByDocNo(userData.CompanyCode, userData.BranchCode, "ASTS", doc_no);
        var resultData = Mapper.Map<AssetTransactionHeaderModel, AssetTransactionHeaderViewModel>(data);
        return Json(resultData, JsonRequestBehavior.AllowGet);

    }
    else
    {
        return null;
    }
}
M. Schena
  • 2,039
  • 1
  • 21
  • 29
Ajith
  • 343
  • 2
  • 23
  • answr : http://stackoverflow.com/a/1767558/5002565 thank you stephen :) – Ajith Feb 02 '16 at 09:53
  • A good place to start is to get your WCF service to return the dates in a more normal format: http://stackoverflow.com/questions/18511147/change-default-date-serialization-in-wcf/27860910#27860910 – Mike Gledhill Feb 02 '16 at 10:06

0 Answers0