Learn ASP MCQs

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

What does the Response.Redirect method do?

1) Sends a response to the client

2) Redirects the user to another page

3) Ends the response

4) Generates a new response

Answer : Redirects the user to another page

Which of the following is a server-side scripting language used in ASP.NET?

1) HTML

2) JavaScript

3) VB.NET

4) CSS

Answer : VB.NET

What does the term "ViewState" refer to in ASP.NET?

1) Data stored in the session

2) Data stored in the cache

3) Data stored between postbacks

4) Data stored in cookies

Answer : Data stored between postbacks

Which control is used to create a data-bound list in ASP.NET?

1) ListBox

2) ComboBox

3) DropDownList

4) Repeater

Answer : DropDownList

How do you declare a variable in ASP.NET?

1) Dim variableName

2) var variableName

3) let variableName

4) Dim: variableName

Answer : Dim variableName

What is the default method for form submission in ASP.NET?

1) GET

2) POST

3) PUT

4) DELETE

Answer : POST

What is an ASP.NET Web API used for?

1) Building server-side applications

2) Creating RESTful services

3) Managing databases

4) Handling user authentication

Answer : Creating RESTful services

Which directive is used to declare an ASP.NET page as a Web Form?

1) <%@ Page %>

2) <%@ WebForm %>

3) <%@ Form %>

4) <%@ ASP %>

Answer : <%@ Page %>

What does the <%: %> syntax do in ASP.NET?

1) Executes code

2) HTML encodes output

3) Defines a variable

4) Imports namespaces

Answer : HTML encodes output

Which method is used to get a value from the QueryString in ASP.NET?

1) Request.QueryString

2) Response.QueryString

3) Request.Parameters

4) Request.Form

Answer : Request.QueryString