Learn ASP MCQs

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

What is the purpose of the Application_OnEnd event?

1) To clean up application-level resources

2) To end a user session

3) To log user activity

4) To initialize application variables

Answer : To clean up application-level resources

How can you convert a string to an integer in ASP?

1) CInt("string")

2) Convert.ToInt("string")

3) Int("string")

4) CInteger("string")

Answer : CInt("string")

Which of the following is not a valid data type in ASP?

1) Integer

2) Boolean

3) Character

4) String

Answer : Character

How do you access an item in a Collection in ASP?

1) collectionName("key")

2) collectionName.key

3) collectionName[key]

4) collectionName.get("key")

Answer : collectionName("key")

What does the Response.ContentType property do?

1) Sets the MIME type of the response

2) Defines the encoding type

3) Specifies the server type

4) Controls session data

Answer : Sets the MIME type of the response

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

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

2) If Session("variable") <> ""

3) If Session("variable") Is Nothing

4) If Session.Exists("variable")

Answer : If Session("variable") Is Nothing

Which object is used to access application-level variables?

1) Application

2) Server

3) Session

4) Request

Answer : Application

How do you read an uploaded file in ASP?

1) Request.Files("fileField")

2) Request.Upload("fileField")

3) Request.File("fileField")

4) Request.GetFile("fileField")

Answer : Request.Files("fileField")

What is the function of the Server.MapPath method?

1) Converts a virtual path to a physical path

2) Fetches session data

3) Handles file uploads

4) Sends responses to the client

Answer : Converts a virtual path to a physical path

Which method is used to return the current date and time in ASP?

1) Now()

2) CurrentDate()

3) DateTime.Now

4) GetDateTime()

Answer : Now()