Learn ASP MCQs

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

How can you access the form data in ASP?

1) Request.Form("fieldName")

2) Request.Data("fieldName")

3) Request.QueryString("fieldName")

4) Request.Input("fieldName")

Answer : Request.Form("fieldName")

What will the following code output: Response.Write("Hello" & " World")?

1) Hello World

2) HelloWorld

3) Error

4) Hello + World

Answer : Hello World

How do you include an external file in ASP?

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

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

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

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

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

Which property of the Request object holds the value of the HTTP method used?

1) Request.HttpMethod

2) Request.Method

3) Request.Type

4) Request.MethodType

Answer : Request.HttpMethod

How do you access a query string variable in ASP?

1) Request.QueryString("variable")

2) Request("variable")

3) QueryString("variable")

4) Request.Get("variable")

Answer : Request.QueryString("variable")

What does the ASP.NET application use to manage sessions?

1) SessionState

2) SessionStorage

3) CookieStorage

4) StateManagement

Answer : SessionState

How do you remove a session variable in ASP?

1) Session.Abandon

2) Session.Remove("variable")

3) Session.Delete("variable")

4) Delete Session("variable")

Answer : Session.Remove("variable")

Which statement is used to redirect the user to a different page?

1) Response.Redirect("url")

2) Redirect("url")

3) Response.Goto("url")

4) Response.Change("url")

Answer : Response.Redirect("url")

What is the syntax to declare a constant in ASP?

1) Const ConstantName = value

2) Dim ConstantName = value

3) Let ConstantName = value

4) Define ConstantName = value

Answer : Const ConstantName = value

How do you handle multiple errors in ASP?

1) On Error GoTo

2) On Error Resume Next

3) On Error Handling

4) On Error

Answer : On Error GoTo