.NET Interview Questions and Answers

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. What is ASP.NET?

ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server. ASP.NET provides increased performance by running compiled code.

5. What is the difference between Classic ASP and ASP.Net?

  • ASP is Interpreted language based on scripting languages like Jscript or VBScript.
  • ASP has Mixed HTML and coding logic.
  • Limited development and debugging tools available.
  • Limited OOPS support.
  • Limited session and application state management. ASP.Net is supported by compiler and has compiled language support.
  • Separate code and design logic possible.
  • Variety of compilers and tools available including the Visual studio.Net.
  • Completely Object Oriented.
  • Complete session and application state management.
  • Full XML Support for easy data exchange.

6. How can we identify that the Page is Post Back?

Page object has an “IsPostBack” property, which can be checked to know that is the page posted back.

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

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

9. What is Difference between Namespace and Assembly?

Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.

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

11. What is the difference between SQL notification and SQL invalidation?

The SQL cache notification generates notifications when the data of a database changes, on which your cache item depends. The SQL cache invalidation makes a cached item invalid when the data stored in a SQL server database changes.

12. What are the advantages of the code-behind feature?

The code-behind feature of ASP.NET offers a number of advantages:
 Makes code easy to understand and debug by separating application logic from HTML tags
 Provides the isolation of effort between graphic designers and software engineers
 Removes the problems of browser incompatibility by providing code files to exist on the Web server and supporting Web pages to be compiled on demand.

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

14. What is a PostBack?

The process in which a Web page sends data back to the same page on the server.

15. What is AutoPostBack?

If you want a control to postback automatically when an event is raised, you need to set theAutoPostBack property of the control to True.

16. What is the difference between static or dynamic assemblies?

Assemblies can be static or dynamic.
Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files.
Dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

17. What is the function of the ViewState property?

The ASP.NET 4.0 introduced a new property called ViewStateMode for the Control class. Now you can enable the view state to an individual control even if the view state for an ASP.NET page is disabled.

18. What are the difference between Structure and Class?

 Structures are value type and Classes are reference type
 Structures can not have constructor or destructors.
 Classes can have both constructor and destructors.
 Structures do not support Inheritance, while Classes support Inheritance.

19. Why do you use the App_Code folder in ASP.NET?

The App_Code folder is automatically present in the project. It stores the files, such as classes, typed data set, text files, and reports. If this folder is not available in the application, you can add this folder. One of the important features of the App_Code folder is that only one dll is created for the complete folder, irrespective of how many files it contains.

20. What is the difference between Custom Control and User Control?

Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox.
Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.
User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged – dropped from it. A User Control is shared among the single application files.

21. What is an ASP.NET Web Form?

ASP.NET Web forms are designed to use controls and features that are almost as powerful as the ones used with Windows forms, and so they are called as Web forms. The Web form uses a server-side object model that allows you to create functional controls, which are executed on the server and are rendered as HTML on the client. The attribute, runat=”server”, associated with a server control indicates that the Web form must be processed on the server.

22. What is IIS? Why is it used?

Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your computer to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request and response cycle on the Web server. It also offers the services of SMTP and FrontPage server extensions. The SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS, such as form handler.

23. What are the types of Authentication?

There are 3 types of Authentication. Windows, Forms and Passport Authentication.
 Windows authentication uses the security features integrated into the Windows NT and Windows XP operating systems to authenticate and authorize Web application users.
 Forms authentication allows you to create your own list/database of users and validate the identity of those users when they visit your Web site.
 Passport authentication uses the Microsoft centralized authentication provider to identify users. Passport provides a way to for users to use a single identity across multiple Web applications. To use Passport authentication in your Web application, you must install the Passport SDK.

24. What is datagrid?

The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.

25. Differentiate globalization and localization.

The globalization is a technique to identify the specific part of a Web application that is different for different languages and make separate that portion from the core of the Web application. The localization is a procedure of configuring a Web application to be supported for a specific language or locale.

Random Articles for You!