.Net Interview Questions
Open in Telegram
1 794
Subscribers
+124 hours
+207 days
+4930 days
Posts Archive
✅2⃣1⃣8⃣ What are the file extensions for razor views?
1. .cshtml - If the programming lanugaue is C#
2. .vbhtml - If the programming lanugaue is VB
Layout pages, can define sections, which can then be overriden by specific views making use of the layout. Defining and overriding sections is optional.
To have a consistent look and feel when using razor views, we can make use of layout pages. Layout pages, reside in the shared folder, and are named as _Layout.cshtml
No, by default content emitted using a @ block is automatically HTML encoded to protect from cross site scripting (XSS) attacks.
✅2⃣1⃣5⃣ When using razor views, do you have to take any special steps to proctect your asp.net mvc application from cross site scripting (XSS) attacks?
✅2⃣1⃣4⃣ What are the levels at which filters can be applied in an asp.net mvc application?
✅2⃣1⃣2⃣ Give an example for Authorization filters in an asp.net mvc application?
1. Authorization filters
2. Action filters
3. Response filters
4. Exception filters
✅2️⃣1⃣1⃣ If I have multiple filters impleted, what is the order in which these filters get executed?
Action Filters allow us to add pre-action and post-action behavior to controller action methods.
1. A Physical File is Found that Matches the URL Pattern - This default behaviour can be overriden by setting the RouteExistingFiles property of the RouteCollection object to true.
2. Routing Is Explicitly Disabled for a URL Pattern - Use the RouteCollection.Ignore() method to prevent routing from handling certain requests
