I have a ActionMethod which I called on Submit button
public Submit ActionResult(Employee emp)
{
emp object has all data like name,emailid, mobileNo etc
--calling business layer to insert data in database
i want to return a view here which is of same controller class I tried it in following ways
return view("ViewName",emp);
in this case i dont have any action name and I redirected to view successfully
but the problem is when I refresh that view it hits to Submits and again entry is made in
database.
return RedirectToAction("ActionName",ViewName,emp);
here i have action which redirects to same view i.e "ViewName"
but in this case it fails to redirect
}
Thanks.

Laxmidhar SahooRank #383 · 6.6K reputationPosted May 5, 2019, 5:02 AM EDT
Ahmed AbdiRank #1,099 · 1.7K reputationPosted May 4, 2019, 7:27 AM EDT
Amit KumarRank #459 · 5.4K reputationPosted May 4, 2019, 8:23 AM EDT
Karan Thakkar186 reputationPosted May 5, 2019, 7:42 PM EDT
Amit KumarRank #459 · 5.4K reputationPosted May 5, 2019, 7:51 PM EDT