Learn ASP MCQs
Prepare ASP MCQs (Multiple choice Questions) for exam and job interviews.
Which method can be used to read from a file in ASP?
1) File.Read
2) File.Open
3) File.Get
4) FileSystemObject.OpenTextFile
Answer : FileSystemObject.OpenTextFile
What is the main function of the Response.End method?
1) To stop the execution of the current page
2) To close the current session
3) To send an HTTP response
4) To redirect to another page
Answer : To stop the execution of the current page
How do you declare a constant in ASP?
1) Const constantName = value
2) Constant constantName = value
3) Let constantName = value
4) Define constantName = value
Answer : Const constantName = value
What is the purpose of the Response.Buffer property in ASP?
1) To control the output to the client
2) To store session data
3) To create dynamic pages
4) To handle user input
Answer : To control the output to the client
Which method is used to clear the response buffer in ASP?
1) Response.Clear
2) Response.Flush
3) Response.ClearBuffer
4) Response.End
Answer : Response.Clear
How do you create a hyperlink in ASP?
1) <a href="link.asp">Link</a>
2) <link href="link.asp">Link</link>
3) <hyperlink src="link.asp">Link</hyperlink>
4) <url link="link.asp">Link</url>
Answer : <a href="link.asp">Link</a>
What does the Request.Files collection contain?
1) Uploaded file data
2) Cookies
3) Query strings
4) Session data
Answer : Uploaded file data
How do you end a session in ASP?
1) Session.Abandon
2) Session.End
3) End.Session
4) Terminate.Session
Answer : Session.Abandon
Which event occurs when a new user accesses an ASP page?
1) Session_OnStart
2) Session_OnEnd
3) Application_OnStart
4) Application_OnEnd
Answer : Session_OnStart
What is the function of the Server.CreateObject method?
1) To create an instance of an ActiveX object
2) To manage sessions
3) To write to the response
4) To read request data
Answer : To create an instance of an ActiveX object