I have a variable is named: myvariable that has some elements (id, name, etc)
in my controller, I calculate some elements of this variable and return it: return View(myvariable).
I have another function in my controller:
public void drawnFromDb(id) {
myclass myvariable;
if (id == "1") {
myvariable.text = "hello";
}
else {
myvariable.text = "world";
}
}
in my javascript function, I calculate the others elements:
function mydrawnFromDb(id) {
$.ajax({
type: "POST",
url: baseUri + "mycontroller/drawnFromDb",
data: { id: id },
success: function () {
},
error: function (error) {
}
});
}
but I need to "return" myvariable to the view.
how can I do it please?
any help appreciated!