Friday, March 27, 2009

Asp.net 1.1/2.0 interview FAQs

1. List some main differences between asp.net 1.1 and asp.net 2.0 ?
Asp.net 2.0 introduces may new Server Controls that enable powerful declarativesupport for data access, login security, menus, tree views, and many more.
  • In asp.net 2.0 there is no need to make a Virtual directory, your application run on local server of asp.net 2.0.
  • In asp.net 2.0 there is no concept of Project but only solution file is there.
  • When you create a new asp.net 2.0 application then only default page and an App_Data folder is in the solution.You have to explicitily add other files.
  • Asp.net have some more features.
  • Master Pages : This feature is used to define common structure and interface for your site like Page header, Footer ,navigation links. These common elements are shared by many pages in your site which access master pages. In other words we can say that you can control the look, feel and much of functionality of your entire Web Site.This improves the maintablity and avoids the duplication of code for site structure or behaviour

  • Personalization : Personalization means custamizing the Web Application according to user account. The profile object is used to build strongly typed,strict data access for user accounts. This also provide a Web Site visitor to Completly control the layout and behaviour of the site.
  • Asp.Net MMC admin Tool : asp.net 2.0 provides a new comprehensive admin tool the plugs into the existing IIS Administration MMC, enabling an administrator to graphically read, or change common settings within the XML config files.
  • 64 bit support : Asp.net 2.0 in 64 bit enabled and can take advantage of full memory address space of new 64 bit processor and servers. Programmers can just copy 32-bit asp.net applications onto a 64 bit asp.net 2.0 server and have the
2. List the differences between an Interface and an Abstract class ?
  • An Interface is used to define methods(have no Body) but not for the implementation whereas An abstract class can be used to implement the Methods.
  • An Interface allows us to use multiple inheritence but not Abstract Classes.
  • A Class can implement more than one Interface but can be inherited from only one Class.
  • Interfaces are slow while Abstract classes are fast.
If various implementations shares only share method signature then it is better to use Interface whereas if implementations also use common behaviour then Abstract class is better to use.

3. What is DLL Hell ?
DLL Hell points to a Set of problems caused when multiple applications attempt to share a common component like a COM or DLL. The most common and troublesome problem was overwriting a working system DLL with a new version causing some applications to fail.
To understand it well let's take a case. Suppose one application installs a new version of shared component that has not backward compatability with the version that is already on the machine.Although the application that has just been installed works well but the problem arise when existing applications that depends on the previous version might no longer works.
Net supports strong binding. Strong binding means an application or component can bind to a specific version of a component, so that you can reuse component or use them isolation. When a .Net component is installed onto the machine, the GAC creates a Strong Name for the component. The component is then registered in the repository and indexed by it's strong Name, so there is no confusion between different versions of the same component or DLL.

4. What is PostBack ?
A postBack is a process in which, when a Page sends a request to the server then the server process the request and Page is submitted to itself.
When a PostBack occurs .......

  • The current value of controls on Page are contained in the PostBack request and called Post Data.
  • The content of ViewState are also in the Post Data.
5. What is the difference Between Inline and Code Behind ?

  • In Inline ..the Code is in "script" blocks in the same .aspx file that containes HTML while in Code Behind..the code is in the seprate .aspx.cs ( for C#) or in .aspx.vb( for VB.Net) file.
  • The aspx file where Inline and HTML code is written in derived from Page Class while Code behined is compiled into a seprate class and then referenced by .aspx file.
  • During Deployment the Inline code is deployed with .aspx page while Code behined is compiled into a sepratevDLL and when a request for DLL is received then an instance of DLL is created and executed.
6. List the differences between DataSet and RecordSet ? Answer
  • RecordSet is Used for a Single table While With DataSet we can work upon multiple tables.
  • RecordSet is Limited to Single database while DataSet can host tables from multiple databases.
  • DataSet can also store the relations between the Tables.
  • A connection should be estabilished every time whenever we work on recordset While DataSet works in disconnected environment.
  • RecordSet is a concept of ADO while DataSet is a concept of ADO.Net.
  • DataSet is XML Based.
7. What is Assembly?
In Assembly can be defined as a compiled code library which is used for deployment, versioning and security.It is a logical unit of code which is of two types (1) DLL and (2) EXE.
Even One Assembly can contain many files.
In .Net when you compile your source code then the exe or dll generated is actually an assembly. The information of Assembly is contained in assembly's menifest.
Assembly's are of two types
Private Assembly : An assembly which is used by a single application is called private assembly. Suppose you created a DLL which contains your Bussiness Logic, then this DLL will be your client application only.B
Shared Assembly : Assembly which is used by many appliocations is called shared assembly. It is present in GAC and have a strong name.
3.8 What is a Strong Name ?
A strong name is assembly's Identity which consists assembly's text name, version number , culture information( if provided), public key and a digital signature. Strong name assemblies are no different from other assemblies except for the fact that they are stored in Global Assembly Cache and could be used across different applications.

9. What is View State ?
Before Asp.Net( Say Classic asp) when a page is submitted on the server, all values on the Page controls get cleared. So you have to fill in all the values again.

So View State can be defined as a state management property of asp.net that retain values across two successive requests for the same page. By default the state is persisted on the client using a hidden field added to the page and is restored on the server before the page request is processed. The View State travels back and forth with the page itself.

Since it's a physical part of the age , it's fast to retrieve and use but it can also become a weakness as it adds a few extra Kb of data as payload. Because it's composed of plain text so it could be tempered and so programmers are not supposed to store sensitive data in the view state (like credit card numbers, passwords etc.).

View State does not hold the controls, rather it holds the values of the form controls and their ID's. It is not used to hold Session data ot to transmit data between pages.

10. What is the purpose of Global.asax ?
Global.asax is used to define all Session and Application level events, which include Session_Start, Session_End, Application_Start, Application_End and Application_Error events.

11. What is Portable Executable (PE) ?
PE is a File Format that all Executable Files (EXE) and Dynamic Link Libraries (DLL) must Follow. PE is derived from the Microsoft Common Object File Format (COFF). The exe and dll files created using the .Net Framework obey the PE/COFF formats and also add additional header and data sections to the files that are only used by the CLR.

12. Name the stages of Page Load Lifecycle ?
Here are four Stages......
  • Init
  • Load
  • PreRender
  • Unload
13. How many types of directives are in asp.net and name

There are 9 types of directives and these are.......
@Page directive
@Register directive
@Import directive
@Assembly directive
@Implements directive
@Reference directive
@OutputCache directive
@MasterType
@PreviousPageType

14. What is the difference between Response.Write( ) and Response.Output.Write( ) ?
Both are used to write output on the page but we can write Formatted output using Response.Output.Write( ).

No comments:

Post a Comment