Wednesday, July 2, 2008

ASP.NET interview questions

ASP.NET interview questions

Q1 # Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe

in the page loading process. inetinfo.exe is theMicrosoft IIS server running,
handling ASP.NET requests among other things.When an ASP.NET request is received
(usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes
care of it by passing the request tothe actual worker process aspnet_wp.exe.

Q2 # What’s the difference between Response.Write() andResponse.Output.Write()?

The latter one allows you to write formattedoutput.

Q3 # What methods are fired during the page load?

nit() - 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 asHTML,

Unload() - when page finishes loading.

Q4 # Where does the Web page belong in the .NET Framework class hierarchy?


Q5 # Where do you store the information about the user’s locale?


Q6 # What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?

CodeBehind is relevant to Visual Studio.NET only.

Q7 # What’s a bubbled event?

When you have a complex control, likeDataGrid, writing an event processing routine for each object (cell, button,row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of itsconstituents.

Q8 # Suppose you want a certain ASP.NET function executed on MouseOver overa
certain button. Where do you add an event handler?

t’s the Attributesproperty, the Add function inside that property. So
A simple”Javascript:ClientCode();” in the button control of the .aspx page will attach the handler (javascript function)to the onmouseover event.

Q9 # What data type does the RangeValidator control support?

Integer,String and Date.

Q10 # Where would you use an iHTTPModule, and what are the limitations of any
approach you might take in implementing one?

One of ASP.NET’s most useful features is the extensibility of the HTTP pipeline, the path that data takes between client and server. You can use them to extend your ASP.NET applications by adding pre- and post-processing to each HTTP request coming into your application. For example, if you wanted custom authentication facilities for your application, the best technique
would be to intercept the request when it comes in and process the request in a custom HTTP module.

Q11 # Explain what a diffgram is, and a good use for one?

A DiffGram is
an XML format that is used to identify current and original versions of data elements. The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the
schema, of the DataSet, including column values from both the Original and Current row versions, row error information, and row order.

Basic .NET and ASP.NET interview questions

1. How many languages .NET is supporting now?

When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

2. How is .NET able to support multiple languages?

a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

3. How ASP .NET different from ASP?

Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

4. What is smart navigation?

The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

5. What is view state?

The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control

6. How do you validate the controls in an ASP .NET page?

Using special validation controls that are meant for this. We have Range Validator, Email Validator.

7. Can the validation be done in the server side? Or this can be done only in the Client side?

Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

8. How to manage pagination in a page?

Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

9. What is ADO .NET and what is difference between ADO and ADO.NET?

ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

No comments: