This is the JSON string after the object is serialized, and we see that the time in the string is in the format \/Date(XXXXX),
It looks very annoying, although the front desk js can convert it to the format of the year, month, day, time, minute and second we need, but, because, I don't want to use js to change,
I want to go directly from the background, what should I do???
Of course, rewrite JsonResult, the code is as follows:
Inherit from JsonResult, and then rewrite the ExecuteResult method as follows:
// Summary: Enables the processing of the results of the operation method by inheriting a custom type from the System.Web.Mvc.ActionResult class. // Parameters: // context: The context in which the results are executed. // Anomaly: // T:System.ArgumentNullException: context parameter is null. public override void ExecuteResult(ControllerContext context); Then, we create a new object, inherit the Controller class, and define a method as follows:
Haha, 90% done, how to use it????
The code is as follows:
Screenshot of success
|