Learn ASP MCQs

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

What does the Session.Abandon method do?

1) Ends the user session

2) Creates a new session

3) stores session data

4) Retrieves session data

Answer : Ends the user session

How do you comment in VBScript?

1) ' This is a comment

2) // This is a comment

3) /* This is a comment */

4) <!-- This is a comment -->

Answer : ' This is a comment

What is the function of the Response.ContentType property?

1) sets the MIME type of the response

2) Redirects the user

3) Creates a session

4) Defines the status code

Answer : sets the MIME type of the response

Which ASP object allows you to interact with the user`s cookies?

1) Cookie object

2) Request object

3) session object

4) Application object

Answer : Cookie object

How do you declare a constant in VBScript?

1) Const ConstantName = value

2) Constant ConstantName = value

3) Dim ConstantName = value

4) Define ConstantName = value

Answer : Const ConstantName = value

What method is used to set an HTTP header in ASP?

1) Response.AddHeader

2) Response.SetHeader

3) Response.Header

4) Response.SendHeader

Answer : Response.AddHeader

Which keyword is used to create a new object in ASP?

1) set

2) New

3) Create

4) Dim

Answer : set

What is the purpose of the On Error Resume Next statement?

1) To handle runtime errors

2) To ignore all errors

3) To stop script execution

4) To log errors

Answer : To handle runtime errors

Which ASP object is used to execute SQL commands?

1) Connection object

2) Command object

3) Recordset object

4) Database object

Answer : Connection object

How do you retrieve a query string value in ASP?

1) Request.QueryString("param")

2) Request("param")

3) Response.QueryString("param")

4) Request.Parameters("param")

Answer : Request.QueryString("param")