Friday, July 1, 2011

ASP.NET INTERVIEW QUESTIONS :

Explain ASP.NET PAGE EXECUTION ARCHITECTURE...
=========================================
Ans: When client request comes to asp.net webpage, webserver will forward the request to asp.net worker process using aspnet_isapi.dll.
Asp.Net worker process will peform 3 steps:
1)Creating a class for asp.net webpage,this class will be inherited from page class.
2)This webpage class will be compiled into dll[dll is a compiled code of asp.net page].
3)It will create webpage class object from dll, this object will be called with process request method. This process request
method will perform page execution and produces output to client browser.[process request is a method of page class].

[(The answer is enough till here but immediatly they will ask 2 more questions from in it as below)].

What is aspnet_isapi.dll and what do you mean by asp.net worker process?
Ans: [aspnet_isapi.dll ===> aspnet Internet Server Application Programming Interface and the
.Net installation will configure webserver with aspnet_isapi.dll

Asp.Net worker process is called as asp.net engine or asp.net runtime, this will encapsulate .net services. This will maintain http application factory. The http application factory will contain all the application names which are loaded into worker process.
required for page execution. Asp.Net worker process will peform the above 3 steps to page execution.

What is the Application Domain ?
Ans : Application domain will contain page handler factory this page handler factory will maintain all the webpage names for which dll is existing.

What is web gardening ? or how will you do the load balancing in asp.net ?
Ans : Executing more than one worker process with more than one processor for a single application is called as web gardening. This is considered as a part of load balancing. Under web gardening more than one application domain will be maintained for a single application by more than one worker process.

Explain ASP.NET PAGE LIFE CYCLE...
============================
Ans: The different stages of the asp.net webpage execution is called the "Asp.Net webpage life cycle".
The different stages of the webpage life cycle are:
1)Start
2)Page Initialization
3)Load
4)Validation
5)Postback events execution
6)Rendering
7)Unload
[(The answer is enough till here if they ask any more we should give the following explanation)]
Explanation:
============
[Page Request: The page request occus before the page life cycle begins].
1)Start:It will create response,request objects and ispostback will be initialized.
2)Page Initialization: In this stage contorls will be created by assigning unique id if any theme is attached
properties will be applied from theme.
3)Load:If it is postback request, the viewstate data will be loaded and cotrols properties will be applied from the viewstate.
4)Validation state:In this stage validations will be take place if validation controls are used in the web page.
5)Postback Events Execution: [Button click, Dropdown list, selectedindexchanged...]
6)Rendering:In this stage webserver controls will produce HTML content the output will be produced to client.
7)Unload:In this stage the memory will be erased(released).

The set of sub programs executed for different stages of page execution are called "page life cycle events".
1)Preinit event
2)Init event
3)Initcomplete
4)Preload
5)Load
6)Load complete
7)Prerender
8)Savestage complete
9)Unload

The differences between ASP and ASP.NET:
========================================
Ans: Differences are:
---------------------
1) Asp supports scripting languages that is Vbscript, Javascript. These are interpreter based.Execution will be slow.
Asp.net supports .net languages that is vb.net,c# these are compiler based.Execution will be faster.
2) Asp doesn't support server side controls.No event driven programing at server side.more burden on developer.
Asp.net supports server side controls. Event driven programming is supported on server. It will reduce burden on developer.
3) Asp is requires manual coding to perform validation.
Asp.net doesn't required manual coding to perform validations.
4) Asp supports only inpapge techniques.
Asp.net supports inpage and code behind techniques.
5) Asp supports only inprocess session state.
Asp.net supports inprocess and out process session state.
6) Asp supports only entire page caching within client location.
Asp.net supports 3 types of caching.(output, fragment and data caching).
7)Asp supports ADO library for database connectivity.
Asp.net supports ADO.Net.
8) Asp doesn't support setup creation.
Asp.net supports setup creation.

[(the below message is for more clarity )].

ASP[Active Server Pages]:
=========================
Asp is a technology provided with IIS in the form of asp.dll for developing dynamic webpage with server
side coding. Asp supports server side coding with the help of VBScript or JavaScript.
Drawbacks of ASP:
=================
1)Lack of Peformance of ASP(because scripting languages are interpreter based languages).
2)No Proper memory management(Scripting languages cann't taken any data types).
3)Coding complexity and no readability(design part code and logic part code into single asp file).
4)No proper state management.
5)No proper caching(asp supports only client side caching, no server side caching).
6)No builtin security support.

To overcome the above problems the solution provided with .Net is Asp.Net.

ASP.NET:
========
Asp.Net is technology providing set of specifications for building web based application.
Asp.Net supports .Net languages for serverside coding ( but VC++.Net programming is not supported by asp.net).
Asp.Net provides two things for dynamic webpage creation with serverside coding.(Asp.Net = .Net languages support + Collection of Objects).

The current version is Asp.Net 4.0 , this provides the following features:
1) Session Shrinking
2) New controls ( Chart controls)
3) Url routing
4) Silver light Integration
5) MVC Support ( Model View Controller).


what is the STATE MANAGEMENT
================== =======
CLIENT SIDE STATEMANAGEMENT:
============================
1)Cookies :
===========

1) What do you mean by Cookie ?
Ans:
2)what are the avantages of Cookies ?
Ans: Following are main advantages of using cookies in web application:
•It's very simple to use and implement.
•Browser's taking care send data.
•For multiple sites cookies, Browser automatically arranges them.
3)what are the disavantages of Cookies ?
Ans: Main disadvantages of cookies are:
•Its store data in a simple text format. so it's not secure at all.
•There is a size limit of cookies data ( 4096 bytes / 4KB).
•Number if cookies also limited. Most Browser provides limits of storing cookies is 20 w.r.t a website.If new cookies came, it will discard the old one. The browser supports up to 300 w.r.t different websites.
•We need to configure browser. It will not work on a high security configuration of browser.
3)How to create cookies ?
Ans: For working with cookies we need to use namespace System.web
4)How to make Persistent Cookies ?
Ans:
5)Where does cookies are stored in local Hard drive ?
Ans:
6)How to remove a persistent cookies before it's Expiration time ?
Ans:
7)What is Cookie Munging?
Ans:
8)Why we are using Cookie Munging in ASP.NET ?
Ans:
9)How do you turn off cookies in your site?
Ans: Use the Cookie.Discard Property which gets or sets the Discard flag set by server. When true this property instructs the client application not to save the cookie on the users hard disk when a session ends.
OR
It can be turned off by mentioning cookie state= false in Web.Config file.
This will turn off session cookie.

2)Hidden Field
3)View State
4)ControlState
5)QueryString(URL)


SERVER SIDE STATEMANAGEMENT:
============================
1)Application
2)Caching
3)Session
4)Context

CACHING:
========
1)OutputCaching
2)FragmentCaching
3)DataCaching

Can we run asp.net application without WEB.CONFIG file ?
=========================================
ans : Yes, we can run an asp.net application without the WEB.CONFIG file. It means that the default configuration will be loaded from MACHINE.CONFIG file.

Can we add more than one Global.asax file to a website ?
=======================================
ans : No

What is the use of Global.asax File in ASP.NET Application ?
==========================================
ans : The Global.asax file is an optional file and can be stored in root directory.
This File is in accesible for web-sites. This Global.asax file contained in HttpApplicationClass.
In Global.asax file we can declare global variables like for example the variables used in master pages because same variables can be used for different pages right.
It provides more security than others.
The Global.asax file is used to handle application-level and session-level events.
we donot worry about configuring Global.asax because it is itself configured.
Accessing the Global.asax file can not be possible.
while one request is in processing it is impossible to send another request, we can not get response for other request and even we can not start a new session.
while adding this Global.asax file to our application bydefault it contains five methods,
Those methods are:
1.Application_Start. 2.Application_End. 3.Session_Start. 4.Session_End. 5.Application_Error.

Web User Control Vs Custom Control :
===========================
1) How can you access a control(like Text box value) value of a user control ?
2) How can you add the user control to a web page?


Difference between Machine.Config and Web.Config ?
==================================================

What is the Tracing ?
===============

SECURITY:
=========
What is Authentication & Authorization?
What are the types of the Authentications ?
What is Membership ?

ADO.NET :
========

LINQ :
=====

WEB SERVICES:
============

WEBPARTS :
=========

AJAX :
=====

SILVERLIGHT :
============

WCF :
====

WPF :
====

SHAREPOINT :
===========