Controller To Controller Data Transfer Mvc. Viewbag uses the dynamic feature that was added in c 40. Add a controller class by right clicking on controllers folder.

It wasnt big move i did but worth to show to beginners how nice code you can write when using correct layering in your application. The controller is the target for posting the data after the user fills out the data input form and clicks the submit button in this case the submit button is labeled update template there are four common ways to construct controller methods to handle data input from the data input form. Name the controller calccontroller.
Viewbag uses the dynamic feature that was added in c 40.
In aspnet mvc data is often transmitted between controller and view. Select mvc 5 controller empty to add an empty controller. Viewdata and viewbag are almost similar and tempdata performs additional responsibility. At times you need to pass data from an action method belonging to one controller to an action method belonging to another controller.