i have child called "shipmentitemlist" and parent named "shipmentlist".
in my child table when i delete 1 row i need to redirect again in shipmenitemlist. the problem is didnot redirect to my child table.
this is my code..
- public ActionResult Delete(int id, ShipmentItemFormModel model)
- {
- var ShipmentId = _shipmentService.GetAll();
-
- if (model.Id > 0)
- {
- try
- {
- var shipmentItem = _shipmentItemService.Get(model.Id);
- _shipmentItemService.Remove(shipmentItem);
- return RedirectToAction("shipmentitemlist", "shipmentlist", new { id = ShipmentId });
- }
- catch (Exception ex)
- {
- ModelState.AddModelError("CustomError", ex.Message);
- return View(PrepareShipmentItemModel(model));
- }
- }
- return View(model);
- }