Questions to be asked by Jobs Team member (Dot Net 2-4 year experience

)
Page |1

1. What are HTML helpers in MVC?
HTML helpers help you to render HTML controls in the view. For instance if you
want to display a HTML textbox on the view , below is the HTML helper code.

<%= Html.TextBox("LastName") %>

For checkbox below is the HTML helper code. In this way we have HTML helper
methods for every HTML control that exists.

<%= Html.CheckBox("Married") %>

2. What is routing in MVC?
Routing helps you to define a URL structure and map the URL with the controller.

For instance let’s say we want that when a user types
“http://localhost/View/ViewCustomer/”, it goes to the “Customer” Controller and
invokes the DisplayCustomer action. This is defined by adding an entry in to
the routes collection using the maproute function. Below is the underlined code
which shows how the URL structure and mapping with controller and action is
defined.

Hide Copy Code
routes.MapRoute(
"View", // Route name
"View/ViewCustomer/{id}", // URL with parameters
new { controller = "Customer", action = "DisplayCustomer",
id = UrlParameter.Optional }); // Parameter defaults

3. Where is the route mapping code written?

The route mapping code is written in "RouteConfig.cs" file and registered using
"global.asax" application start event.

4. Ca e ap ultiple URL’s to the sa e actio ?

Yes, you can, you just need to make two entries with different key names and
specify the same controller and action.

5. What is difference between TempData and ViewData ?

“TempData” maintains data for the complete request while “ViewData” maintains
data only from Controller to the view.

Confidential: Dot Net Questions- www.chetu.com
V04242017
Created by Prashant Kumar (TA)

What are the different types of action filters?  Authorization filters  Action filters  Result filters  Exception filters 8. What does information assemblyinfo. 7. 9. Protected: Access is limited to the containing class or types derived from the containing class. AssemblyInfo. Private: Access is limited to the containing type. description and trademark etc. it wraps the value inside a System.chetu. a database. What is boxing and unboxing? Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type.www. Confidential: Dot Net Questions. And various details including company. When the CLR boxes a value type. 10.Object and stores it on the managed heap. Unboxing extracts the value type from the object. Questions to be asked by Jobs Team member (Dot Net 2-4 year experience) Page |2 6. What is serialization? Serialization (C# and Visual Basic) Serialization is the process of converting an object into a stream of bytes in order to store the object or transmit it to memory. What is Access modifiers in C#? Total 5 type in C# Public: Access is not restricted. 11. Its main purpose is to save the state of an object in order to be able to recreate it when needed. Does Te pData p ese e data i the ext e uest also? “TempData” is available through out for the current request and in the subsequent request it’s available depending on whether “TempData” is read or not.cs file consists.cs file contains details about the assembly name. Protected internal: Access is limited to the current assembly or types derived from the containing class. version info and security info. Internal: Access is limited to the current assembly. So if “TempData” is once read it will not be available in the subsequent request.com V04242017 Created by Prashant Kumar (TA) . or a file.

13. all the queries have to be written (mixed up) with the business logic code. This create problem while debugging. But while writing inline queries. It helps in providing fast access to data based on the values stored in the column. Types of indexes: Clustered: Stores the actual row at the leaf level of the index. I f we use stored procedure we can avoid recompilation of the query.www. Difference between inline query and stored procedure Query and stored procedure do the same thing but the difference is that a query should be compiled every time the query is executed.: If an index is created on primary key of a table and then search for a row based on primary key value then SQL Server first finds that value in the index and then uses the index to locate the row in the table instead of performing a complete table scan. E. What is an index and types of indexes? Index is created on a column in tables. Questions to be asked by Jobs Team member (Dot Net 2-4 year experience) Page |3 12. Diff between primary key and unique key Primary Key:  Can be only one in a table  It never allows null values  Primary Key is a unique key identifier and cannot be null Unique Key:  Can be more than one unique key in one table  Unique key can have null values(only single null is allowed)  It can be a candidate key  Unique key can be null and may not be unique Confidential: Dot Net Questions. Therefore we can create a separate layer. By using stored procedures we can separate all the queries from the Business logic code. while the stored procedure is in compiled form when executed first time.chetu.com V04242017 Created by Prashant Kumar (TA) . No clustered: Stores only the values from the indexed column and row locators that point to the actual row at leaf level instead of the actual row itself.g. 14.