I need to call a JavaScript function in a Controller function.
My code looks like the following:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(DeviceLocation locationToEdit)
{
var originalLocation = (from m in _db.DeviceLocations
where m.Id == locationToEdit.Id
select m).First();
if (!ModelState.IsValid)
return View(originalLocation);
_db.ApplyCurrentValues(originalLocation.EntityKey.EntitySetName, locationToEdit);
_db.SaveChanges();
Utility.mostRecentLocationUpdate = locationToEdit;
/******************************************
need to call updateMap() JavaScript function
*******************************************/
return RedirectToAction("Locations");
}
Thanks!
You need to poll the server with Ajax, use sockets (very limited support), or comet to ask the server for new data. The server can not just send down the data at will.