I am using below function to call a function on controller:
function getPartialView(actionUrl, targetDiv, ajaxMessage, callback) {
showAjaxMessage(targetDiv, ajaxMessage);
$.get(actionUrl, null, function (result) {
$(targetDiv).html(result);
callback();
});
}
and calling it like this:
getPartialView("UCDamage", "#dvdamageAreaMid", "Loading...", function () { });
this function provides me facility just like updatePanel in classic asp.net web forms. now please tell me how can i pass values in function as a parameter.
actually the UCDamage is a user control which will be randered in div:dvdamageAreaMid. the code is written on current form on which i am displaying this userControl named "UCDamage". but i need to pass some values to this function in controller.
my controller function is like this:
public ActionResult UCDamage(string searchText)
{
SecureModelService service = new SecureModelService();
return View(service.ListBodyWork(searchText));
}
i have tried with taking textbox with namex searchText and retrieve its value but not able to get it.
Please provide me some suggestion and help me out. Thanks