Webinar Recap: Getting Started with ASP.NET MVC

Dhananjay Kumar / Wednesday, November 11, 2015

On November 6th we hosted a webinar titled “Getting started with ASP.NET MVC” for the Indian region and we’d like to share the presentation and recorded webinar with you now! In the webinar, we covered:

  • Getting started with ASP.NET MVC
  • Understanding Controllers
  • Understanding Views
  • Understanding Model
  • ViewBag, ViewData, and TempData
  • Strongly Typed and dynamic views
  • Child Action and Partial Views
  • Areas
  • Database first approach

You can find recording of the webinar here:

You can also find the presentation slides here.

Some of the questions from the webinar are below:

What is the difference between ViewBag and ViewData?

ViewBag and ViewData are both used to pass data from controller to view.  Their characteristics are as follows:

ViewData is a property of type ViewDataDictionary class:

  • Data can be passed in the form of a key-value pair.
  • To read the complex type data on the view, typecasting is required.
  • To avoid exception, null checking is required.
  • Life of ViewData is restricted to the current request and becomes Null on redirection.
  • ViewData is a property of the ControllerBase class

ViewBag is a property of dynamic type.

  • Data is passed as a property of the object.
  • There is no need of typecasting to read the data.
  • There is no need of null checking.
  • Life of ViewBag is restricted to the current request and becomes Null on redirection.
  • ViewBag is property of ControllerBase class.

What is a Child Action?

Child Actions are the action methods which can be invoked within the view.

  • This is used to work with the data in the view, which are not related to the main action method
  • In ASP.NET MVC any action can be used as a child action
  • To use an action only as a child action and attribute it with the ChildActionOnly. It will make sure the action is not called by any user request and will only be used in the view.

What are the different types of Views?

Different types of Views are:

  1. Dynamic view
  2. Strongly typed view

Is it a must to use Entity Framework in MVC applications?

No, it is not required - you can use any database technology to work with databases in the MVC application, including but not limited to:

  • LINQ to SQL
  • Entity Framework
  • ADO.NET
  • Any ORM

Once again, thank you so much for your interest in our webinars – and we look forward to seeing you at a future webinar!