view bag

What is ViewBag?

ViewBag is an object which is dynamically passing the data from Controller to View and this will pass the data as the property of object ViewBag. We do not need to typecast to read the data for null checking here.

Controller:

 

 

View:

 

 

Here is an example:

Controller:

 

 

View:

 

Free Shipping.

All orders of $49 or more of eligible items across any product category qualify.

Payment Methods.

Credit Card: Visa, MasterCard, Maestro, American Express.

Returns & Refunds.

You can return any item purchased on Shella within 20 days of the delivery date.