Posts

Showing posts from April, 2021

ASP.NET MVC Interview Questions Part - IIl Day 27

Image
Lecture 27 : ASP.NET MVC Interview Questions Part - III 1) What is dependency injection  ? Injecting the dependent object by some one else rather than controller creating. Dependency injection is a design pattern in which a class requests dependencies from external sources rather than creating them. Angular's DI framework provides dependencies to a class upon instantiation.  You can use Angular DI to increase flexibility and modularity in your applications. 2) How can we read Configuration data from appsettings.json ? Getting Values from appsettings.json : There are one or more ways available to fetch values from appsettings.json file in .NET Core. Following are the ways we are going to learn : Using IConfiguration : The IConfiguration is available in the dependency injection (DI) container, so you can directly access  JSON  properties by simply injecting IConfiguration in the constructor of a controller or class.  It represents a set of key/value application  configuration  pro

ASP.NET MVC Interview Questions Part - II Day 26

Image
Lecture 26 : ASP.NET MVC Interview Questions Part - II 1) How is the URL structure of MVC core ? URL structure of MVC core is controller name with action name. Example : localhost:1234/{controller}/{action name}. The "localhost:1234" is considered as a controller name. 2) If the view name is different than action name how to invoke it  ? If the view name is different from action name we have to write and the view in double quotes. 3) How do we define navigation using anchor tag ? The HTML <a> element (also called the anchor element), containing its href attribute, creates a hyperlink to other web pages, locations within the same page, location to a specified title of another web page, or to an email web page.  The <a> tag defines a hyperlink, which is used to link from one page to another. The navigations can be defined using anchor tag as <a href="/Controller name/Action name"></a>. 4)  How to pass mode

ASP.NET MVC Interview Questions Part - I Day 25

Image
Lecture 25 : ASP.NET MVC Interview Questions Part - I 1)  What is ASP.NET MVC  ? ASP.NET is A web application framework to develop website which can run on Map, Linux and any other platforms. ASP.NET MVC is nothing but architecture pattern. The MVC model also provides full control over HTML, CSS, and JavaScript . The Model  is the part of the application that handles the logic for the application data.(Has a business logic) The View  is the part of the application that handles the display of the data.(Has a look an feel UI) The Controller  is the part of the application that handles user interaction.(Connect the model on the view) 2) Why do we need Appsettings.json ? The appsettings. json file is an application configuration so this configuration for example, configuration like connection string and version number, so all this are appsettings.json. Appsettings.json file has parameter configuration. 3) What is JSON ? JSON stands for JavaScript Object Notation.  JSON is no