Hi @SPIDEY JOE ,
Why you redirect to the "SamlpeGrid"? I think you need return the view. And then in the page, you need to show it. Just like this:
@using (Html.BeginForm("action", "controller", FormMethod.Post))
{
@Html.EditorFor(m => m.UserName)
<input type="submit" value="Submit" />
}
@{
if(ViewBag.Message != null)
{
<div>
@ViewBag.Message
</div>
}
}
[HttpPost]
public ActionResult AddCat(CategoryModel obj)
{
.......
return view();
}
Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.