.NET Interview Questions with Answers Page II


From freshersonline.com

Jump to: navigation, search

Interview Question Home

1. What is .NET?


.NET is essentially a framework for software development.It is similar in nature to any

other software development framework (J2EE etc) in that it provides a set of runtime

containers/capabilities, and a rich set of pre-built functionality in the form of class

libraries and APIs The .NET Framework is an environment for building, deploying, and running

Web Services and other applications. It consists of three main parts: the Common Language

Runtime, the Framework classes, and ASP.NET.


2. 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.


3. 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.


4. 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.


5. 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.


6. 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


7. 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.


8. 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.


9. 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.


10. 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.


11. What is Web.config?


In classic ASP all Web site related information was stored in the metadata of IIS. This had

the disadvantage that remote Web developers couldn't easily make Web-site configuration changes.

For example, if you want to add a custom 404 error page, a setting needs to be made through the

IIS admin tool, and you're Web host will likely charge you a flat fee to do this for you. With

ASP.NET, however, these settings are moved into an XML-formatted text file (Web.config) that

resides in the Web site's root directory. Through Web.config you can specify settings like custom

404 error pages, authentication and authorization settings for the Web sitempilation options for the

ASP.NET Web pages, if tracing should be enabled, etc.

The Web.config file is an XML-formatted file. At the root level is the tag. Inside this tag you can

add a number of other tags, the most common and useful one being the system.web tag, where you will

specify most of the Web site configuration parameters. However, to specify application-wide settings

you use the tag.


For example, if we wanted to add a database connection string parameter we could have a Web.config

file like so.


12. Creating a Key Pair?

You can create a key pair using the Strong Name tool (Sn.exe). Key pair files usually have an .snk

extension. To create a key pair At the command prompt, type the following command:


sn k

In this command, file name is the name of the output file containing the key pair.

The following example

creates a key pair called sgKey.snk.


sn -k sgKey.snk


13. What are the Types of Assemblies?

Assemblies are of two types:

1. Private Assemblies

2. Shared Assemblies


14.What is Private Assemblies ?


he assembly is intended only for one application. The files of that assembly must be placed

in the same folder as the application or in a sub folder. No other application will be able

to make a call to this assembly. The advantage of having a private assembly is that, it makes

naming the assembly very easy, since the developer need not worry about name clashes with other

assemblies. As long as the assembly has a unique name within the concerned application, there

won't be any problems.


15. If the assembly is to be made into a Shared Assembly, then the naming conventions are very

strict since it has to be unique across the entire system. The naming conventions should also

take care of newer versions of the component being shipped. These are accomplished by giving the

assembly a Shared Name. Then the assembly is placed in the global assembly cache, which is a folder

in the file system reserved for shared assemblies.

Personal tools