Skip to content

ASP.NET Interview Questions

Reading Time: 3 minutes

The ASP.NET interview questions listed  here are usually asked to freshers/beginners or developers having less than 1 year of relevant ASP.NET experience.

1. What is ASP.NET?

It is used to create dynamic Web applications, Web sites, and Web services. ASP.NET is a framework developed by Microsoft. Currently ASP.NET 4.0 is used to develop web sites. Microsoft provides various page extensions which are used for web site development. Example: asmx, aspx, asks, Essex, Cs, vb, XML, html etc.

2. What are then used to store information on server side?

  • Application State
  • Cache Object
  • Session State

3. Define ViewState?

ViewState retains the state of server-side objects between page post backs.

4. List the two different Session State management options in ASP.NET?

  • In-process
  • Out-process

5. Write a code to add an event handler?

Event Handler can be added by using the Attributes property of the server side control.

btnSubmit.Attributes.Add("onMouseOver","JavascriptCode();

6. List the client side state management system?

  • View state
  • Control state:
  • Hidden fields:
  • Cookies
  • Query strings

7. List the validators in ASP.NET?

  • Range  Validator
  • Compare Validator
  • Custom Validator
  • Required field Validator
  • Regular expression Validator
  • Summary Validator

8. Define Caching?

It is a technique used to increase performance by keeping frequently accessed data or files in memory. Client side request for a cached file/data will be accessed from cache instead of the actual location of that file.

9. What are the different kinds of assemblies?

Static assemblies– It can be stored on disk in executable files.

Dynamic assemblies– It can’t be stored on disk before the execution, they run directly from memory.

See also  Top 25+ Important Big Data Interview Questions

10. Define cookies?

A cookie is a small file that the server embeds on the user’s computer often used to identify a user. After creating a cookie time an additional HTTP header is sent to the browser when a page is served to the browser.

11. Write code to create cookie?

To create cookie “Response. Cookies” command is used to create cookies.

In the example below, I have created a cookie named “name” and assign the value “Tom” to it:

<%
Response.Cookies("name")="Tom"
%>;

To set expire time of cookie

<%
Response.Cookies("name")="Tom"
Response.Cookies("name").Expires=#December 10,2016#
%>

12. Write code to apply themes to an asp.net application?






13. What is Boxing and UnBoxing?

Boxing is defined as assigning a value type variable to reference type variable.

UnBoxing is a reverse process of boxing. i.e assigning a reference type variable to a value type variable.

14. List  two new properties are added in ASP.NET 4.0 Page class?

The two new properties added in ASP.NET 4.0 Page class are  MetaDescription and MetaKeyword .

15. List the templates of the Repeater control?

  • AlternatingltemTemplate
  • SeparatorTemplate
  • HeaderTemplate
  • FooterTemplate
  • ItemTemplate

asp.net interview questions

16. What is the default timeout for a cookie?

30 minutes is the default timeout for a cookie.

17. What are the Datatypes supported by a RangeValidator control support?

The data types supported by RangeValidator are

Integer, Double, , Currency, String, and Date.

18. Define appSetting section in web.config file?

It is used to set the user defined values for web application.

Ex:





19. List the namespaces used to create a localized application?

  • System.Resources and
  • System.Globalization

20. Define Components?

Components are defined as group of classes and methods which are logically related. It should uses class that implemented IComponent interface or at least implement IComponent interface.

21. How do content page and master page differ?

A master page has a complete HTML source code and the content page has would not be having the complete HTML source code

22. Define Reflection?

It is a technique used to access the types defined in the metadata of each module can be accessed.

System. namespace has the classes that can be used to define the types of an assembly.

23. List down all design pattern?

Creational Design Pattern

  • Abstract Factory
  • Singleton
  • Prototype
  • Builder
  • Factory Method

Structural Design Patterns

  • Composite
  • Decorator
  • Bridge
  • Façade
  • Adapter
  • Flyweight
  • Proxy

Behavioral Design Patterns

  • Interpreter
  • Template Method
  • Strategy
  • Chain of Responsibility
  • State
  • Memento
  • Visitor
  • Iterator
  • Command
  • Observer
  • Mediator

24. Without using JavaScript how can we use MessageBox in ASP.NET?

By adding the reference to the System. Windows. Forms library and by using the method-

MessageBox (“ASP.NET”) we can use MessageBox in ASP.NET.

25. Explain methods Response. Output. Write () and Response. Write ()?

Response. Output. Write () – it allows you to write the formatted output.

Response. Write () – it allows you to write the normal output.

Leave a Reply