c# - Display Success message on the same page when submit -
i'm using html.beginform
in view page , parameters using formcollection
controller want return success message on same viewpage
result.i'm using following code,
public string insertdetails(formcollection collection) { string result = "record inserted successfully!"; return result; }
it shows success message on new page.how can resolve this? have return success message on same page?
personally i'd pop result string viewbag.
public actionresult insertdetails(formcollection collection) { //do logic insert details viewbag.result = "record inserted successfully!"; return view(); }
then on web page:
<p>@viewbag.result<p/>
Comments
Post a Comment