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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -