1. View models in an ASP.NET web application are A. any model that drives a view
ID: 3909502 • Letter: 1
Question
1. View models in an ASP.NET web application are
A. any model that drives a view.
B. models that drive views but are not stored in the database.
C. models that are stored in the database but don't drive views.
D. not models.
E. views that drive models.
2. In an ASP.NET web application, the ViewBag object
A. is a collection of views.
B. is a way to access the model behind a view.
C. passes data from _Layout.cshtml to the view body.
D. all of the above.
E. none of the above.
3. In an ASP.NET web application, C# custom helper functions are placed in the ____ folder.
A. Content
B. Scripts
C. bin
D. App_Code
E. App_Start
4. In an ASP.NET web application, advertisement content that appears on many of the pages on the site should be placed in
A. the main view for each page
B. in the shared _Layout.cshtml file
C. a partial view dedicated to that advertisement
D. the ViewBag object
E. None of the above
Explanation / Answer
1. View models in an ASP.NET web application are, any model that drives a view, that is it is a model for the view, A view model represents the data that will be displayed on the view/page
2. In an ASP.NET web application, the ViewBag object, is a way to access the model behind a view, that is in accordance to Microsoft Developer Network, the ViewBag allows you to share values dynamically to the view from the controller. As such, it is considered a dynamic object without pre-set properties.
3. In an ASP.NET web application, C# customer helper functions are placed in the App_Code folder.
we define our @helper methods within the same view template as the code that called it. Alternatively, we can define the @helper methods outside of our view template, and enable it to be re-used across all of the view templates in our project. We can accomplish this by saving our @helper methods within .cshtml/.vbhtml files that are placed within a App_Code directory.
4. In an ASP.NET web application, advertisement content that appears on many of the pages on the site should be placed in the shared _Layout.cshtml file, such that the same will be reused and implemented through out the multiple view/web pages
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.