ASP.NET with essential interview questions and answers. Perfect for beginners and pros, this guide boosts your skills and interview readiness. At Softloom IT Training

1. What does ASP.NET stand for?

A) Active Server Pages .NET
B) Advanced Server Pages .NET
C) Application Server Pages .NET
D) Automated Server Pages .NET

Answer: A) Active Server Pages .NET

2. ASP.NET is developed by which company?

A) Google
B) Microsoft
C) IBM
D) Oracle

Answer: B) Microsoft

3. Which programming language is primarily used in ASP.NET?

A) C++
B) Java
C) C#
D) Python

Answer: C) C#

4. What is the` primary function of the ASP.NET framework?

A) Develop mobile applications
B) Develop dynamic web applications
C) Develop desktop applications
D) Develop database management systems

Answer: B) Develop dynamic web applications

5. Which model does ASP.NET use for web development?

A) MVC (Model-View-Controller)
B) MVVM (Model-View-ViewModel)
C) MVP (Model-View-Presenter)
D) All of the above

Answer: A) MVC (Model-View-Controller)

6. Which of the following is the default session state in ASP.NET?

A) In-Process
B) State Server
C) SQL Server
D) Custom

Answer: A) In-Process

7. What is the extension of an ASP.NET web page file?

A) .html
B) .php
C) .aspx
D) .jsp

Answer: C) .aspx

8. Which method is used to force a page to be posted back to the server in ASP.NET?

A) PostBack()
B) IsPostBack()
C) Response.Redirect()
D) Server.Transfer()

Answer: B) IsPostBack()

9. What is ViewState in ASP.NET?

A) A method for storing session state
B) A method for preserving data between postbacks
C) A security feature in ASP.NET
D) A database optimization technique

Answer: B) A method for preserving data between postbacks

10. What is the purpose of the Global.asax file?

A) Storing user credentials
B) Handling global application events
C) Managing database connections
D) Storing configuration settings

Answer: B) Handling global application events

11. Which of the following is NOT an ASP.NET server control?

A) GridView
B) DropDownList
C) CheckBox
D) AlertBox

Answer: D) AlertBox

12. What is the role of Web.config in an ASP.NET application?

A) Storing database records
B) Configuring application settings
C) Defining CSS styles
D) Managing HTML structure

Answer: B) Configuring application settings

13. Which of the following is used for routing in ASP.NET MVC?

A) RouteConfig.cs
B) Global.asax
C) Web.config
D) Index.cshtml

Answer: A) RouteConfig.cs

14. What does IIS stand for in the context of ASP.NET?

A) Internet Information Services
B) Internal Information Server
C) Integrated Internet System
D) Interactive Internet Services

Answer: A) Internet Information Services

15. Which of the following authentication modes is available in ASP.NET?

A) Windows
B) Forms
C) Passport
D) All of the above

Answer: D) All of the above

16. What is the function of the Session object in ASP.NET?

A) Stores user session data
B) Stores database records
C) Stores CSS styles
D) Stores web service data

Answer: A) Stores user session data

17. Which of the following represents a server-side scripting language in ASP.NET?

A) JavaScript
B) VB.NET
C) CSS
D) HTML

Answer: B) VB.NET

18. What is Razor in ASP.NET?

A) A JavaScript framework
B) A database tool
C) A view engine for ASP.NET
D) A web security feature

Answer: C) A view engine for ASP.NET

19. Which of the following is a lifecycle event of an ASP.NET page?

A) Page_Init
B) Page_Load
C) Page_PreRender
D) All of the above

Answer: D) All of the above

20. What does AJAX stand for in ASP.NET?

A) Asynchronous JavaScript and XML
B) Advanced Java Application eXchange
C) Automated JavaScript and XHTML
D) Asynchronous JSON and XML

Answer: A) Asynchronous JavaScript and XML

21. What does the Server.Transfer() method do?

A) Redirects to another page on the same server
B) Redirects to an external website
C) Downloads a file from the server
D) Stops the web application

Answer: A) Redirects to another page on the same server

22. What is the difference between Response.Redirect() and Server.Transfer()?

A) Response.Redirect() changes the URL in the browser, Server.Transfer() does not
B) Server.Transfer() changes the URL in the browser, Response.Redirect() does not
C) Both methods work the same way
D) Response.Redirect() only works in MVC

Answer: A) Response.Redirect() changes the URL in the browser, Server.Transfer() does not

23. Which of the following can be used for state management in ASP.NET?

A) ViewState
B) Session
C) Cookies
D) All of the above

Answer: D) All of the above

24. How do you comment a single line in C#?

A) // This is a comment
B) /* This is a comment */
C) <!– This is a comment –>
D) # This is a comment

Answer: A) // This is a comment

25. What is a Master Page in ASP.NET?

A) A template for multiple web pages
B) A class for database connectivity
C) A type of authentication method
D) A tool for error handling

Answer: A) A template for multiple web pages

26. What is the default language used in ASP.NET code-behind files?

A) Python
B) C#
C) Java
D) PHP

Answer: B) C#

27. What does the Runat=”server” attribute do in ASP.NET?

  1. A) Makes an HTML element a server-side control
    B) Runs JavaScript on the server
    C) Runs the application on the client-side
    D) Compiles the HTML file

Answer: A) Makes an HTML element a server-side control

28. What is the use of HttpContext in ASP.NET?

A) It stores information about the current HTTP request
B) It provides debugging information
C) It is used for database connectivity
D) It controls JavaScript execution

Answer: A) It stores information about the current HTTP request

29. Which method is used to clear a session in ASP.NET?

A) Session.Clear()
B) Session.RemoveAll()
C) Session.Abandon()
D) All of the above

Answer: D) All of the above

30. What is ASP.NET Core?

A) A lightweight, cross-platform version of ASP.NET
B) A database engine
C) A JavaScript framework
D) A browser extension

Answer: A) A lightweight, cross-platform version of ASP.NET