Learn ASP MCQs

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

What is the purpose of the Err object in ASP?

1) To handle runtime errors

2) To log application events

3) To manage user sessions

4) To create dynamic content

Answer : To handle runtime errors

How can you include external files in ASP?

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

2) <link href="filename.asp">

3) <script src="filename.asp"></script>

4) <import src="filename.asp">

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

Which property of the Request object is used to get query string values?

1) Request.QueryString

2) Request.String

3) Request.Values

4) Request.Data

Answer : Request.QueryString

How do you handle errors in ASP?

1) On Error Resume Next

2) Try...Catch

3) HandleError

4) If...Then

Answer : On Error Resume Next

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

1) 12

2) 3

3) Error

4) 1 2

Answer : 12

Which event is triggered when an application starts in ASP?

1) Application_OnStart

2) Session_OnStart

3) Application_OnEnd

4) Session_OnEnd

Answer : Application_OnStart

Which method is used to read a file in ASP?

1) File.Read

2) FileSystemObject.OpenTextFile

3) Response.ReadFile

4) File.Open

Answer : FileSystemObject.OpenTextFile

What is the purpose of the Request.ContentType property?

1) To get the type of content sent by the client

2) To specify the response type

3) To set the MIME type

4) To define the character set

Answer : To get the type of content sent by the client

Which operator is used for string concatenation in ASP?

1) &

2) +

3) |

4) &&

Answer : &

How do you declare an array in ASP?

1) Dim arrayName()

2) Dim arrayName[]

3) Dim arrayName{}

4) arrayName = new Array()

Answer : Dim arrayName()