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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -