控制器代码:
using Layout.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Layout.Controllers
{
public class DateTimeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult GetJson1()
{
Student student = new Models.Student();
student.ID = 1;
student.Name = "张艺兴";
student.Age = 28;
student.Pwd = "123";
student.Tel = "12345432";
student.Birthday = DateTime.Now;
return Json(student, JsonRequestBehavior.AllowGet);
}
}
}
Models代码:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace Layout.Models
{
public class