Friday, April 9, 2021

ASP.NET MVC Interview Questions Part-3


ASP.NET MVC Interview Questions Part-3

    

What is  Dependency Injection?

Dependence injection means injecting the dependent object by some one else rather than creating himself .




How can we read configuration data from appsettings.json?

By using IConfiguration object.

               






What is the need of viewdata?

Viewdata helps us to transfer data from controller to the view.

Example: ViewData["vi"]='' abc''

                                 

                           

                                 


                                


What is the difference between Viewdata and Viewbag?

Viewbag is similar to the Viewdata .

It is used to transfer data from controller to view.

Viewbag is nothing but syntactic sugar over Viewdata.

Typecasting, Null checks are not required.

Example: ViewBag.vi

                  

                       


Viewdata helps us to transfer data from controller to the view.

Typecasting, Null checks are required.

Syntax: ViewData["vi"]=''abc''




For more understanding watch below video :

No comments:

Post a Comment

Function in SQL -part 8

  In this blog we are going to understand  Sql function.   FUNCTION: A function is a database object in SQL Server. It accepts only input pa...