2
public int Id { get; set; }
public string Name { get; set; }
public string Adres { get; set; }
public string Surname { get; set; }
控制器:
[HttpGet]
public Student GetStudentById(int id)
{
var output = RepositoryFactory.Create<IStudentRepository>().GetByID(id);
return output;
}
JS:
.click(function() {
$.ajax({
type: "GET",
url: '/Admin/GetStudentById/',
data: { id: object_id },
success: function (response) {
$('#toolbox-text').val(response)
}
})
而問題是,我要得到這個item.Name ,item.Adres和item.Surname在3個文本框中,但是當我鍵入response.Adres時,我什麼也沒有得到。當我輸入只是響應我得到:MyNewProject.Models.Student在文本框中。
是的工作,謝謝:) – Lubudubu1010 2014-09-19 20:49:48