ASP.Net MVC related questions Hi Friends, Now days, there are many companies asking about the ASP.Net MVC related questions in their interview process. So I thought of keeping few questions related to MVC and ASP.Net MVC. These questions will be help to all those who are attending the interviews or preparing for the ASP.Net MVC related questions. Here I am keeping the questions related to all the versions of ASP.Net MVC by keeping in mind that interviewer can ask the questions from any aspect. 1. What is MVC? Ans. MVC (Model View Controller) is one of the Software Architectural patterns which is built on 3 layers- Model layer, View layer and Controller layer. MVC is a pattern which basically talks about the separation of concern for a project where each of these layer is separate without any dependency. Here the 3 layers having their own individual roles like: a. Model - It is used as the Data Container. Mainly we write the public properties under this laye...
Posts
Most Interesting Questions in C#, ASP.Net and SQL Server, WCF, ASP.Net MVC
- Get link
- X
- Other Apps
Most Interesting Questions in C#, ASP.Net and SQL Server, WCF, ASP.Net MVC Hello Guys, In this article, we will see the most interesting questions in Microsoft Technologies like in C#, ASP.Net, Sql Server, WCF services, ASP.Net MVC. Q 1. I have logged in to the ASP.Net website using my credential for the login page. Now I want that when my session is expired, it should logout the application and show the login page. With that It should also logged out from the Windows and I should use the Windows credentials again to reach to my application again. How do you think it can be done? Ans. This question is related to the Sessions in ASP.Net where the session time out is configured for the current user. And when the session gets expired, we need to set so that it should automatically come back to login page and user need to enter the credentials again. Session time can be set as: Q 2. In .Net Framework, Garbage collector is used for the Automatic Memory Management(to free-up the me...
3-6 yr Experience Interview Questions in .Net Technologies
- Get link
- X
- Other Apps
3-6 yr Experience Interview Questions in .Net Technologies Hai Friends, Below I am posting the questions and answers for the short questions for 3-6 years experience guys. These questions will be helpful for those who are either preparing for the interview or attending the interviews. This will also be helpful for the last minute preparation in quickest way. If anyone has better answers, please reply to this post and I will include the better answer to the post as it will be helpful for all of us. CLR and C# 1. Types of Authentication IIS. A. Authentication is the process which helps web server(IIS) to check and confirm the identity of the client who request to access the website. Types of Authentication: a. Http Authentication: Basic Authentication, Digest Authentication b. Integrated Windows Authentication: NTLM(Network Lan Manager), Kerberos c. Client Certificates Access d. Anonymous and UnAuthenticated Access e. Logon-Redirection based: Form Authentication(IIS 7.0) ...
Explain what is the difference between View and Partial View?
- Get link
- X
- Other Apps
View: It contains the layout page. Before any view is rendered, viewstart page is rendered. View might have markup tags like body, html, head, title, meta etc. View is not lightweight as compare to Partial View. Partial View: It does not contain the layout page. Partial view does not verify for a viewstart.cshtml.We cannot put common code for a partial view within the viewStart.cshtml.page. Partial view is designed specially to render within the view and just because of that it does not consist any mark up. We can pass a regular view to the RenderPartial method.
Explain what is routing in MVC? What are the three segments for routing important?
- Get link
- X
- Other Apps
Routing is a mechanism to process the incoming url that is more descriptive and give desired response. In this case, URL is not mapped to specific files or folder as was the case of earlier days web sites. There are two types of routing (after the introduction of ASP.NET MVC 5). Convention based routing: to define this type of routing, we call MapRoute method and set its unique name, url pattern and specify some default values. Attribute based routing: to define this type of routing, we specify the Route attribute in the action method of the controller. Routing is the URL pattern that is mappped together to a handler,rounting is responsible for incoming browser request for particular MVC controller. In other ways let us say routing help you to define a URL structure and map the URL with controller. There are three segments for routing that are important, ControllerName ActionMethodName Parammeter i.e: ControllerName/ActionMethodName/{ParamerName} and als...
What are Action Filters in MVC?
- Get link
- X
- Other Apps
Action Filters: Action Filters are additional attributes that can be applied to either a controller section or the entire controller to modify the way in which action is executed. These attributes are special .NET classes derived from System.Attribute which can be attached to classes, methods, properties and fields. ASP.NET MVC provides the following action filters: Output Cache: This action filter caches the output of a controller action for a specified amount of time. Handle Error: This action filter handles errors raised when a controller action executes. Authorize: This action filter enables you to restrict access to a particular user or role.
What are Filters in MVC?
- Get link
- X
- Other Apps
In MVC, controllers define action methods and these action methods generally have a one-to-one relationship with UI controls such as clicking a button or a link, etc. For example, in one of our previous examples, the UserController class contained methods UserAdd, UserDelete, etc. But many times we would like to perform some action before or after a particular operation. For achieving this functionality, ASP.NET MVC provides feature to add pre and post action behaviors on controller's action methods. Types of Filters: ASP.NET MVC framework supports the following action filters: Action Filters: Action filters are used to implement logic that gets executed before and after a controller action executes. We will look at Action Filters in detail in this chapter. Authorization Filters: Authorization filters are used to implement authentication and authorization for controller actions. Result Filters: Result filters contain logic that is executed before and after a view...