Asp.Net Interview Questions and Answers
Question - 101 : - Explain the differences between Server-side and Client-side code?
Answer - 101 : - Server-side code executes on the server. Client-side code executes in the client's browser.
Question - 102 : - What type of code (server or client) is found in a Code-Behind class?
Answer - 102 : - The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
Question - 103 : - Should user input data validation occur server-side or client-side? Why?
Answer - 103 : - All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
Question - 104 : - Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Answer - 104 : - Valid answers are:
· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
· A DataSet is designed to work without any continuing connection to the original data source.
· Data in a DataSet is bulk-loaded, rather than being loaded on demand.
· There's no concept of cursor types in a DataSet.
· DataSets have no current record pointer You can use For Each loops to move through the data.
· You can store many edits in a DataSet, and write them to the original data source in a single operation.
· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
Question - 105 : - What is the Global.asax used for?
Answer - 105 : - The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
Question - 106 : - What are the Application_Start and Session_Start subroutines used for?
Answer - 106 : - This is where you can set the specific variables for the Application and Session objects.
Question - 107 : - Can you explain what inheritance is and an example of when you might use it?
Answer - 107 : - When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.
Question - 108 : - Whats an assembly?
Answer - 108 : - Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN
Question - 109 : - Describe the difference between inline and code behind.
Answer - 109 : - Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
Question - 110 : - Explain what a diffgram is, and a good use for one?
Answer - 110 : - The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.