model :
public int Id { get; set; }
public string Name { get; set; }
public string Adres { get; set; }
public string Surname { get; set; }
controller:
[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)
}
})
And the problem is that i want to get this item.Name, item.Adres and item.Surname in 3 textboxes but when i type response.Adres i get nothing. When i type just response i get: MyNewProject.Models.Student in textbox.