ASP .NET Interview Questions- Part 1

What are steps in an asp .net page lifecycle?
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

2.What is the main difference between Response.Write() and Response.Output.Write()?
With Response.Outout.Write options are available to you to write the formatted out put.

3.When implementing classes what are the specifics of an abstract method?
An Abstract method does not provide any implementation. The class containing it can not be instantiated it must be inherited. The deriving class must override abstract methods declared in parent class, unless it is an abstract class it self.

4.List all Validation Controls available in asp .net?
RequiredFieldValidator : Checks if a control has a value.
RangeValidator : Checks if the control’s value is within a certain range.
RegularExpressionValidator : Checks whether the value of an input control matches a certain pattern
CompareValidator : Checks a control’s value against a constant or another control value.
CustomValidator : Checks a control’s value against a customized validation logic.
ValidationSummary : Displays a list of all validation errors

5.What data types do the RangeValidator control support?
Integer, String, and Date.

6.Is C# .net case sensitive?
Yes it is.

7.What is the difference between a class and struct ?
A struct is a value type while a class is a reference type. There’s no inheritance with

8.When passing a variable by reference to a method what is the difference between keywords ref and out?
When using the key word ref the variable must be initialize before calling the method,
while initialization is not mandatory when using out.

9.What are specifics for Static class?
Static class is implemented with the Keyword Static in the class definition.
It must contain only static members and methods. Public members of static class can be accessed without the class instantiation. Static class are sealed by default therefore can not be inherited. Static class cannot be instantiated.

10.What part of the code is usually called Code-Behind?
The Server side code is usually called Code-behind as reference to the fact that in a web application it is actually the part of the code handling the large part of the execution.

11.What part of the code is called Inline Code?
The asp .net client side code is usually call inline code. From most browsers it can be
view by choosing 'View source' from the page menu.

12.What is the difference between doing a Dataset.Clone() and Dataset.Copy()?
Dataset.Clone() will copy just the dataset structure including all the datatables,
schemas, relations and constraints; it will not copy the data. Dataset.Copy() will copy
both dataset structure and data.

13.What is the role of Global.asax file?
The Global.asax include its code behind file Global.asax.cs, it is use to implement
application and session level events.

14.What utility is used to manually deploy an assembly?
The GacUtil is a utility tool that comes with visual studio, it is use to deploy an
assembly by adding it into the GAC(Global Assembly Cache).

Ex: Type at the command line prompt
C:\gacutil /i ASPMyComponent.dll
will install ASPMyComponent into the GAC

15.Define MSIL. How is it use in the .Net framework?
MSIL stand for Microsoft Intermediate Language. During the compilation process, code written in any .NET compatible languages(J#, C#, VB,C++) is converted into MSIL. MSIL then create a compatibility bridge among these language before execution by the virtual machine.

16. What are differences between ASP.Net and Classic ASP?
-ASP programming is based on scripting languages like Jscript or VBScript which evolves around a mixture of scripting and HTML. ASP .net is base on an advance structured compiled language.
-ASP .net gives the option of separating the code behind (compiled code) from the design code or client code (HTML).
-ASP .net with visual studio .net provides an advanced application and session state
management, while ASP performs poorly at providing it.
-ASP has a poor error handling capability compare to ASP .net which has it much completed and much advanced.
-ASP does not have a built-in mechanism for XML while ASP .net comes with a full XML capability support.
-ASP .net has a fully distributed data source support which is missing from classic ASP

17.What property is use to set alternate color scheme in a Repeater control?

18.What is the base class for Web Forms?
The System.Web.UI.Page class.

19.What are the meaning of terms boxing and un-boxing?
Boxing: Implicit conversion of a value type into a reference type.
Un-Boxing: Explicit conversion of a reference type into a value type. Can also be call

20.Give a brief description of how the heap and stack are managed in .Net.
Stack and heap are memory sections of the .net application. The CLR(Common Language Runtime) is in charge of managing those sections.
Value type variables are stored in the stack where storing order is Last in first out.
When a variable is out of scope it basically fall off the stack.
Refence type variable are stored on the heap where storing order is First in first out.
When a variable becomes out of scope it is mark for collection.

The GC(Garbage Collector) is the part of the CLR responsible for cleaning up the heap releasing resources occupied by Reference type variables.


To link to this blog, copy and paste the code below into your site.

  © Blogger template 'Tranquility' by 2008

Back to TOP