Learn ASP MCQs

Prepare ASP MCQs (Multiple choice Questions) for exam and job interviews.

What is the purpose of the Response.Buffer property?

1) To enable response buffering

2) To set the content type

3) To end the response

4) To redirect to another page

Answer : To enable response buffering

Which of the following is NOT a valid ASP data type?

1) Integer

2) string

3) Boolean

4) Character

Answer : Character

What does the Server.MapPath method do?

1) Converts a relative URL to a physical path

2) Redirects the user

3) Creates a new session

4) sends data to the client

Answer : Converts a relative URL to a physical path

How can you include another ASP file in the current page?

1) <!--#include file="file.asp" -->

2) <%@ include file="file.asp" %>

3) <include file="file.asp">

4) <import file="file.asp">

Answer : <!--#include file="file.asp" -->

What is the primary use of the Application.Lock method?

1) To prevent simultaneous access to application variables

2) To create a new application

3) To remove application variables

4) To check application status

Answer : To prevent simultaneous access to application variables

Which method is used to close a database connection in ASP?

1) Connection.Close

2) Connection.End

3) Connection.Disconnect

4) Connection.Terminate

Answer : Connection.Close

Which ASP.NET control can be used to display a list of items?

1) DropDownList

2) TextBox

3) Label

4) Button

Answer : DropDownList

What is the main function of ASP.NET?

1) To create static websites

2) To create dynamic web applications

3) To manage databases

4) To create mobile applications

Answer : To create dynamic web applications

What does the Page_Load event in ASP.NET do?

1) Runs when the page is first created

2) Runs when the page is refreshed

3) Runs before the page is rendered

4) Runs after the page is loaded

Answer : Runs when the page is first created

What is the purpose of the Global.asax file?

1) To configure database connections

2) To define application-level events

3) To store user settings

4) To manage session state

Answer : To define application-level events