Learn ASP MCQs
Prepare ASP MCQs (Multiple choice Questions) for exam and job interviews.
Which function is used to format a date in ASP?
1) FormatDateTime()
2) DateFormat()
3) FormatDate()
4) DateTimeFormat()
Answer : FormatDateTime()
What type of data can be stored in an ASP session variable?
1) Any data type
2) Only strings
3) Only numbers
4) Only dates
Answer : Any data type
How do you check if a session variable is set?
1) If Not IsEmpty(Session("variable"))
2) If Session("variable") Is Nothing
3) If Session("variable") = ""
4) If Session("variable") Is Null
Answer : If Not IsEmpty(Session("variable"))
What is the purpose of the ASP Response object?
1) To send data to the client
2) To handle incoming requests
3) To manage session state
4) To store application variables
Answer : To send data to the client
Which ASP method can be used to clear the contents of the response buffer?
1) Response.Clear
2) Response.Flush
3) Response.End
4) Response.ClearAll
Answer : Response.Clear
What will the following code output: Response.Write(5 + 5)?
1) 10
2) 55
3) Error
4) 5 5
Answer : 10
How can you retrieve the HTTP method used in a request?
1) Request.HttpMethod
2) Request.Method
3) Request.Type
4) Request.MethodType
Answer : Request.HttpMethod
How do you read form data sent via POST in ASP?
1) Request.Form("fieldName")
2) Request.Get("fieldName")
3) Request.QueryString("fieldName")
4) Request.Post("fieldName")
Answer : Request.Form("fieldName")
Which method is used to create a cookie in ASP?
1) Response.Cookies("name")
2) Request.Cookies("name")
3) Set-Cookie
4) Cookie.Create("name")
Answer : Response.Cookies("name")
How can you close an ASP session?
1) Session.Abandon()
2) Session.Close()
3) Session.End()
4) Session.Exit()
Answer : Session.Abandon()