In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the ASP.net mvc interview questions". The explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the ASP.net mvc interview questions"?
Question 1: what is ASP.net mvc?
This is a development framework for network applications. A lightweight framework that is easy to test. It divides the whole application into three components: model view controller.
Question 2: explain model view controller.
Model is a data model that represents the data we use in applications.
Controller handles various user requests and redirects the user to view.
View is the layer that our users can see.
Question 3: explain the new features of mvc 4.
① asynchronous control processing.
② JavaScript Bundling.
Separation of ③ configuration methods. Mvc path, web API and bundle.
Template support for ④ mobile.
Template support for ⑤ Rest API service.
Question 4: what components do we need to create a path?
The first is the path name.
The second is the url of the path.
The other one is defaults. When called, the action that needs to be called in a controller along with the parameters.
Question 5: what are the benefits of mvc for ASP.net?
① provides very clear performance management, such as the ui layer, or view, the data layer model, and the management controller.
② unit testing is relatively easy.
③ improves the reusability of data models and views.
The structure of ④ code is more optimized.
Question 6: what is separation of concerns?
It's a process of decomposition. Decompose a large function into several small functions, and the overlap between several small functions is very low. For mvc, it is more concerned with layering from the presentation layer to data processing.
Question 7: can a view be shared among multiple controller?
Yes, of course.
You can put this view in a shared folder. When we create a new mvc project, the layout page will be added to the shared folder because it will be called by multiple sub-pages.
Question 8: what does unobstrusive JavaScript mean?
This javascript means that JavaScript will not be embedded in the tags on your page.
Question 9: what is the role of view model in mvc?
Viewmodel is a normal class with many properties that can be bound to a view. It can also set some validation rules through properties.
Question 10: what is the path in Mvc?
The path has two main parts, one is the string of the path, and the other is its handler. Search this path and the corresponding request method, and then find the corresponding handler.
Question 11: what is actions in Mvc?
Actions is a method in controller, which mainly deals with two parts of content, one is view, the other is json data. Its return type is action result, which is called through the invoke action method.
Question 12: what is the attribute path?
Attribute paths can be defined at either the controller level or the action level. It's been around since mvc 5.
Question 13: how to activate attribute paths?
Add map mvc attribute routes to the registerRoutes to activate the attribute path.
Question 14: what is json binding?
Starting with mvc3, use json value provider factory to support json binding. Allows the action method to receive and bind data of type json. This is very useful when sending data to the server.
Question 15: explain dependency resolution.
The main purpose of this is to do dependency injection, which makes the code coupling very low and makes it easier to test.
Question 16: explain the bundle.config in mvc4.
This file is mainly used to register some very useful libraries like jquery.
Question 17: how is the path table created in dot net mvc?
RegusterRoutes is used to register various paths, and this method is called in the application start method, which exists in the global.asax file. When the program starts, it will be called.
Question 18: why use "{resource} .asd / {* pathinfo}"?
This is done mainly to prevent network resource files, such as web resource.asd, or script resource.asd, from being transferred to a controller.
Question 19: what is view data?
Viewdata, which is a data dictionary with key and value, is derived from viewdata dictionary. In the action method, we can set the value of viewdata, and in the view, we can get these values.
Question 20: what is the difference between view bag and view data?
View bag is an extension of view data. Dynamic properties can be created after the extension. The advantage is that there is no need for type conversion. We can use the dynamic keyword.
But one drawback is that view bag is slower than view data.
Question 21: explain temp data.
It is derived from temp data dictionary and is similar to view data. It is also a combination of key and value. It is mainly used in the interaction of two requests, which may be two actions or two controllers. It requires type conversion when used in a view.
Question 22: what is html Helpers?
Html helpers is equivalent to a control in a traditional web form. But it is more lightweight and does not save attempted states and events.
It returns the html string, which can be displayed directly on the web page. You can customize html helpers when deriving from html helper.
Question 23: what is ajax helpers?
It is a mechanism for making further requests for web tables, and its extension method exists in System.Web.Mvc.
Question 24: what are the options for configuring ajax helper?
Url, this is the requested link.
Confirm this is used to specify the confirmation message to be displayed.
The On begin method is called before the ajax request.
On Complete, this method is called after the ajax request.
On success this method is called when the ajax request is successful.
On failure, this method is called when the ajax request fails.
Update trigger ID. There will be a target element in the html returned by action, and this ID corresponds to this element.
Question 25: explain render body and render page.
Render body is equivalent to content place holder in a table on a web page. It exists in layout pages, where a layout page has only one render body. There can be more than one render page in a layout page.
Question 26: what is view start page?
This page is used to make a general-purpose layout page, it can be used by multiple views, and the code in this file will be executed first when the program loads.
Question 27: explain how to display the view.
View returns a view in action.
Partial view, which returns part of the view in action.
Redirect to action. It is used to redirect to different action, it can be in a controller or in a different controller.
Question 28: how to change the name of action?
You can use the action name attribute to change the name of the action.
[actionname ("testactionview")]
Question 29: what is validation anotations?
The data anotations exists in system.componentmodel.data. Anotations. It can be used as either server-side authentication or client-side authentication. There are four attributes, one is required, one is string length, one is regular expression, and one is range.
Question 30: why use html.partial?
This method is used to display a piece of view specified by html string.
Html.partial ("testpartialview")
Question 31: what is html.Renderpartial?
This method writes data to the response. There is no return value.
@ {html.renderpartial ("testpartialview")}
Question 32: what is a scaffold template?
Used to generate controller,model,views, corresponding to these functional operations of create,read.
Thank you for your reading, the above is the content of "what are the ASP.net mvc interview questions?" after the study of this article, I believe you have a deeper understanding of what the ASP.net mvc interview questions have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.