How to call action after submit in MVC
Now, I want after posting/Submit, and then first action again recalls populating value on initial stage.
I have below action for loading value in value.
public ActionResult CreateBigBale()
{
var secID = 0;
ViewBag.secID = new SelectList(DB.Sections.Where(bt => bt.SecID > secID), "SecID", "Secnam", "0");
var codeItem = 0;
ViewBag.codeItem = new SelectList(DB.ItemMasterFiles.Where(bt => bt.CodeItem > codeItem && bt.TiD==2 ), "Codeitem", "Descriptionitem", "0");
var cID = 0;
ViewBag.cID = new SelectList(DB.Catagories.Where(bt => bt.CID > cID), "CID", "CName", "0");
var bigbaleMV = new CascadingModel();
bigbaleMV.Prdnoa = sdb.GeneateBBID();
bigbaleMV.Prdno = bigbaleMV.Prdnoa[0].Prdno;
return View(bigbaleMV);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult CreateBigBale(CascadingModel bigbalemv)
{
var newbigbale = new Probale();
newbigbale.Prdno = bigbalemv.Prdno;
newbigbale.Codeitem = bigbalemv.CodeItem;
newbigbale.SecID = bigbalemv.SecId;
newbigbale.prdqty = 1;
newbigbale.CID = bigbalemv.Cid;
newbigbale.EntryDate = DateTime.Now;
DB.Probales.Add(newbigbale);
DB.SaveChanges();
return Redirect("~/BBPV.aspx?Prdno=" + bigbalemv.Prdno);
}