Home > MVC > How To Display Message using ViewBag In MVC



How To Display Message using ViewBag In MVC

In this article, we will explain how to display message using ViewBag in MVC with an example and a sample code.


In this article, we will explain how to display a message using ViewBag in MVC with an example and a sample code. In this example, we have created a sample form page, We are using ViewBag to display message in the View after button click.

 

Step -1

Open Visual Studio. Click on the file in the menu and select new Project .

How To Display Message using ViewBag In MVC

 

Step -2

Select new project type.

How To Display Message using ViewBag In MVC

 

Index.cshtml

We have provided html code below.

 

Model

 

StockController

 

Screenshot

How To Display Message using ViewBag In MVC

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*