Dot Net Interview Questions Part 20

1. Difference between the "throw" and "throw ex" in .NET?
Ans.If you use "throw" statement, it preserve original error stack information.·
If you use "throw ex" statement, stack trace of the exception will be replaced with a stack trace starting at the re-throw point.
So it is very important to just use the throw statement, rather than "throw ex" because it will give you more accurate error stack information.

2. What is the index value of the first element in an array?
Ans. First element is always 0 (zero) in a Array.

3. What are the types of Constructors in .net?
Ans. Generally constructors are 5 types as follows
1. Default Constructor
2. Parameterized Constructor
3. Copy Constructor
4. Static Constructor
5. Private Constructor

4.What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
Ans. The first one performs a deep copy of the array, the second one is shallow.

5. What is worker process?
Ans. Worker process (w3wp.exe) is an executable which is also called as the Application Factory. This is used for the execution of the request and handling of the request for the current web page.

6. What are Razor engines? How they are differ from ASP Engines?
Ans. RAZOR engine is the new concept in the MVC 3.o which is mainly used to create the views in the MVC applications.
It created the cshtml pages for the MVC application and cshtml pages can be generated automatically by using the Razor engine.ASP engine create the aspx pages while Razor engine creates the pages

7. In how many different ways can JavaScript be used/called in an application?
Ans. JavaScript can be used for Client Side validation, can also be used for calling of server side methods and functions, can be used for calling the web services etc.

8. What is the default Form Method (i.e. Get or Post) for an Action method in Asp.Net MVC?
Ans:  GET. To change this you can add an action level attributes e.g(HttpPost)

9 .Which filters are executed in the end ?
Ans: Exception Filters

10. Where the routing rules are defined in an MVC application?
Ans: When application start,The Appilication_start event occurred and RegisterRoutes value will be defined in Global.aspx


Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker