Home

1000+ Asp Programming MCQ for GATE [Solved]

Thursday 9th of March 2023

Sharing is caring

1. To write an attribute for a tag through ASP.NET use
A. WriteAttribute
B. WriteStartAttribute
C. WriteAttributeString
D. WriteElementString
Answer : C
2. Choose the form in which Postback occur
A. HTMLForms
B. Webforms
C. Winforms
D. None of these
Answer : B
3. What namespace contains the classes for file and directory access?
A. System.IO
B. System.File.IO
C. System.Data
D. System.IO.Data
Answer : A
4. What is used to validate complex string patterns like an e-mail address?
A. Extended expressions
B. Basic expressions
C. Regular expressions
D. Irregular expressions
Answer : C
5. To send attachments using SMTP use
A. MailAttachment and MailMessage
B. CDO
C. Any one of the above
D. None of the above
Answer : A
6. .FileInfo gives information about any file and .File gives information about a particular file
A. True
B. False
C.
D.
Answer : B
7. To save an XML file from ASP.NET use
A. Save
B. Update
C. SaveXML
D. UpdateXML
Answer : A
8. ___________ sets the time out period for a particular page in seconds
A. Session.Timeout
B. Server.ScriptTimeout
C. Response.Expires
D. Response.ExpiresAbsolute
Answer : B
9. _________ object represents all information sent form a browser to a server
A. Response
B. Request
C. Session
D. Application
Answer : B
10. One difference between ASP.NET and ASP is that ASP is more structure than ASP.NET
A. True
B. False
C.
D.
Answer : B
11. __________ and __________ event are the two most commonly supported server-side events. (Click and Change)
A. Click and Change
B. Click and DblClick
C. KeyUp and KeyDown
D. KeyEnter and KeyPress
Answer : A
12. If passwords are to be sent from one page to another, we can use
A. Get method
B. Post method
C. Session variables
D. Any one of the above
Answer : D
13. ____________ enables you to add, modify and delete records and you will see the changes made by other users
A. OpenForwardOnly
B. OpenKeyset
C. OpenDynamic
D. OpenStatic
Answer : C
14. ______________ creates a read-only recordset that can scroll forward only.
A. OpenForwardOnly
B. OpenKeyset
C. OpenDynamic
D. OpenStatic
Answer : A
15. To open Microsoft Word from ASP.NET page use
A. Response.Content
B. Response.ContentType
C. Request.Content
D. Request.ContentType
Answer : B
16. Error handling can be done through Global.asax
A. True
B. False
C.
D.
Answer : A
17. Which of the following method must be overridden in a custom control?
A. The Paint() method
B. The Control_Build() method
C. The default constructor
D. The Render() method
Answer : D
18. ASP.NET is object oriented
A. True
B. False
C.
D.
Answer : A
19. Default Session data is stored in ASP.Net.
A. StateServer
B. Session Object
C. InProcess
D. all of the above
Answer : C
20. You want to ensure that the user ID is saved between requests when the user is moving through pages. What will you do?
A. Use Session variables
B. Use Application variables
C. Any one of the above
D. No of the above
Answer : A
21. What keyword is necessary to expose a public function as a method of a Web Service?
A. WebSub()
B. WebFunction()
C. WebMethod()
D. WebClass
Answer : C
22. The HTML control that helps to browse a file is
A. File
B. FileBrowser
C. Browser
D. Select
Answer : A
23. ____________ converts virtual path to default path
A. Server.MapPath and Request.MapPath
B. Server.MapPath and Response.MapPath
C. Response.MapPath and Request.MapPath
D. All of the above
Answer : B
24. In ___________ records are read-only and cannot be changed.
A. LockReadOnly
B. LockPessimistic
C. LockOptimistic
D. LockDynamic
Answer : A
25. What class does the ASP.NET Web Form class inherit from by default?
A. System.Web.UI.Page
B. System.Web.UI.Form
C. System.Web.GUI.Page
D. System.Web.Form
Answer : A
26. To make an HTML control behave as a Server control, ___________ option must be set.
A. Server Control
B. Run As Server Control
C. Run As Web Control
D.
Answer : B
27. We can write an XML document from ASP.NET without mentioning the encoding format ie even without specifying 'Nothing'
A. True
B. False
C.
D.
Answer : B
28. Radio Button's have same name and different values while Checkboxes have the reverse
A. True
B. False
C.
D.
Answer : A
29. You can specify a function name in
A. CustomValidator
B. RequiredFieldValidator
C. RangeValidator
D. ValidationSummary
Answer : A
30. _________ is used to write/read into a leaf node
A. Value
B. InnerText
C. Text
D. InnerValue
Answer : B
31. ASP.NET use
A. Compiler
B. Interpreter
C.
D.
Answer : A
32. An alternative way of displaying text on web page using
A. asp:label
B. asp:listitem
C. asp:button
D. None of these
Answer : A
33. In case of a CompareValidator, a TextBox's value can be compared to an expression
A. True
B. False
C.
D.
Answer : B
34. There can be more than one Global.asax file
A. True
B. False
C.
D.
Answer : B
35. .DirectoryInfo gives information about any Directory
A. True
B. False
C.
D.
Answer : B
36. ASP.NET uses _______ as the code behind
A. VB
B. VBScript
C. JavaScript
D. Jscript
Answer : A
37. A ValidationSummary control is bound to a control
A. True
B. False
C.
D.
Answer : B
38. ASP.NET if fully compatible with ASP
A. True
B. False
C.
D.
Answer : B
39. HTML elements, HTML server controls and ASP.NET server controls can be used on the same form
A. True
B. False
C.
D.
Answer : A
40. In the Adrotator XML file ________ is used to mention the file to link to
A. <ImageUrl>
B. <NavigateUrl>
C. <Url>
D. <Link>
Answer : B
41. Checkboxes have same name and different values while Radio Buttons have the reverse
A. True
B. False
C.
D.
Answer : B
42. To make a RepeaterControl viewable, the controls ____________ must be edited
A. DataSource
B. DataMember
C. ItemTemplate
D. Template
Answer : D
43. To redirect an user to a particular page when a user logs in use
A. Use Response.Redirect in Session_Start event of Global.asax file
B. Use Response.Redirect in Application_Start event of Global.asax file
C. Use Server.MapPath in Session_Start event of Global.asax file
D. Use Server.MapPath in Application_Start event of Global.asax file
Answer : A
44. For Adrotator control the XML file is mentioned through ________ property
A. File
B. Name
C. Advertisement File
D. Ad File
Answer : C
45. Can you have more than one form declaration on a web form?
A. Yes
B. No
C.
D.
Answer : B
46. Which of the following is not a member of ADODBCommand object?
A. ExecuteScalar
B. ExecuteStream
C. Open
D. ExecuteReader
Answer : C
47. To pass queries to Crystal Reports use
A. SelectionFormula
B. Formula
C. Filter
D. None of the above
Answer : A
48. Default path for any web application is
A. .\Inetpub\Folder_name
B. .\Inetpub\www\Folder_name
C. .\Inetpub\wwwroot\Folder_name
D. .\Inetpub\mailroot\Folder_name
Answer : C
49. A DataSet can be generated from
A. Page and DataConnection Object
B. DataAdapter and Page Object
C. DataAdapter and DataConnection Object
D. All of the above
Answer : B
50. How can you check if the page is visited for the first time
A. Use PostBack
B. Use IsPostBack
C. Use Post
D. Use Get
Answer : B

Sharing is caring