Tuesday, 15 September 2015

Experienced ASP.Net Interview Questions and Answers

61. Which control would you use if you needed to make sure the values in two different controls matched?
CompareValidator control.

62. How many classes can a single .NET DLL contain?
It can contain many classes.

63. What is the lifespan for items stored in ViewState?
Item stored in ViewState exist for the life of the current page.  This includes postbacks (to the same page).

64. What does the "EnableViewState" property do?  Why would I want it on or off?
It allows the page to save the users input on a form across postbacks.  It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser.  When the page is posted back to the server the server control is recreated with the state stored in viewstate.

65. What are the different types of Session state management options available with ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management.  In-Process stores the session in memory on the web server.  This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server.  Out-of-Process Session state management stores data in an external data source.  The external data source may be either a SQL Server or a State Server service.  Out-of-Process state management requires that all objects stored in session are serializable.

66. What is the difference between Value Types and Reference Types? 
Value Types uses Stack to store the data where as the later uses the Heap to store the data.
67. What are user controls and custom controls?
Custom controls:  A control authored by a user or a third-party software vendor that does not belong to   the .NET Framework class library. This is a generic term that includes user controls. A  custom server control is used in Web Forms (ASP.NET pages). A custom client control is used  in Windows Forms applications.
User Controls: In ASP.NET: A user-authored server control that enables an ASP.NET page to be re-used   as a server control. An ASP.NET user control is authored declaratively  and persisted as a  text file with an .ascx extension. The ASP.NET page framework compiles a user control on  the fly to a class that derives from the        System.Web.UI.UserControl class.

68. What are the validation controls?
 A set of server controls included with ASP.NET that test user input in HTML and Web server  controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation  controls can also perform validation using client script.

69. Where do you add an event handler?
It's the Attributesproperty, the Add function inside that property.
e.g. btnSubmit.Attributes.Add("onMouseOver","someClientCode();")

70. What data type does the RangeValidator control support?
Integer,String and Date.

More Questions & Answers:-
Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8

No comments:

Post a Comment