Learn ASP MCQs

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

Which method is used to terminate the session in ASP?

1) Session.Abandon

2) Session.End

3) Session.Terminate

4) Session.Close

Answer : Session.Abandon

How do you create an object in ASP?

1) Set objName = Server.CreateObject("ObjectName")

2) objName = new Object("ObjectName")

3) CreateObject("ObjectName")

4) Dim objName = new Object("ObjectName")

Answer : Set objName = Server.CreateObject("ObjectName")

What is the purpose of the SessionID property?

1) To get the unique identifier for a session

2) To store user data

3) To limit session duration

4) To manage cookies

Answer : To get the unique identifier for a session

Which method retrieves the number of items in a collection in ASP?

1) Count

2) Length

3) Size

4) Total

Answer : Count

What will the following code output: Response.Write(1 + 2 + "3")?

1) 33

2) 6

3) Error

4) 1 23

Answer : 33

How can you check if a session variable exists in ASP?

1) If Not IsEmpty(Session("variable"))

2) If Session("variable") Is Nothing

3) If Session("variable") = ""

4) If Not Session("variable") Is Nothing

Answer : If Not Session("variable") Is Nothing

Which object is used to handle runtime errors in ASP?

1) Err

2) Error

3) Log

4) Response

Answer : Err

Which of the following is a method for server-side scripting in ASP?

1) VBScript

2) JavaScript

3) HTML

4) CSS

Answer : VBScript

What is the correct way to comment in ASP?

1) <%-- Comment --%>

2) <!-- Comment -->

3) // Comment

4) /* Comment */

Answer : <%-- Comment --%>

Which ASP object is used to send data to the client?

1) Response

2) Request

3) Server

4) Session

Answer : Response