in a cshtml file i have a model that i want to populate with variables taken from controls to send to the controller (by post). how would you do this? Is there any example codes
I want to be able to set a POCO (TMGrading) in the model which I can then persist to a database
function SaveNewTMFunction() {
var message = webix.message(“Save functionality”);
$$(“dynamicboxdatatablechaggercreation”).add({
Title: $$(“myformaddtourmanagerdetails”).getValues().tmname,
Year: $$(“myformaddtourmanagerdetails”).getValues().year,
Votes: $$(“myformaddtourmanagerdetails”).getValues().votes
})
this.Model = new TMGrading();
this.Model.PersistGrade.Id = 0;
this.Model.PersistGrade.Title = $$(“myformaddtourmanagerdetails”).getValues().tmname;
this.Model.PersistGrade.Year = $$(“myformaddtourmanagerdetails”).getValues().year;
this.Model.PersistGrade.Votes = $$(“myformaddtourmanagerdetails”).getValues().votes;
Alert(this.Model.PersistGrade.Votes);
}