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

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -