I'm using Html.Beginform
in view page and get the parameters using FormCollection
to the controller i want to return the Success message on the same ViewPage
as a result.i'm using following code,
public string InsertDetails(FormCollection collection)
{
string result = "Record Inserted Successfully!";
return result;
}
It shows the success message on the new page.How can i resolve this? what i have to return to get the Success message on the same page?
Best Answer
Personally, I'd pop the result string into the ViewBag.
Then on the web page: