Home

UPSC CSE - Asp Programming 1000+ MCQ [Solved] PDF Download

Thursday 9th of March 2023

Sharing is caring

1. Radio Button's have same name and different values while Checkboxes have the reverse
A. True
B. False
C.
D.
Answer : A
2. What class does a Web Service Inherit?
A. System.Web.Services
B. System.Web
C. System.Services
D. System.Web.Page
Answer : A
3. You need to modify an ASP.NET page to prevent the browser window from going blank after a postback and to maintain the correct control focus after events are processed. What should you do?
A. Add the following attribute to the HTML code for the controls that cause the postbacks:
RunAt="client"
B. Add the following attribute to the HTML code for the controls that cause the postbacks:
EnableViewState="True"
C. Add the following attribute to the Page directive for the aspx file:
SmartNavigation="True"
D. Add the following attribute to the OutputCache directive for the aspx file:
Location="client
Answer : C
4. A ValidationSummary control is bound to a control
A. True
B. False
C.
D.
Answer : B
5. Error handling can be done through Global.asax
A. True
B. False
C.
D.
Answer : A
6. Attribute must be set on a validator control for the validation to work.
A. ControlToValidate
B. ControlToBind
C. ValidateControl
D. Validate
Answer : A
7. 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
8. The default method of a WebForm is
A. Page_Load
B. WebForm_Load
C. Form_Load
D. Page_Init
Answer : A
9. To save an XML file from ASP.NET use
A. Save
B. Update
C. SaveXML
D. UpdateXML
Answer : A
10. Which of the following is not a member of ADODBCommand object?
A. ExecuteScalar
B. ExecuteStream
C. Open
D. ExecuteReader
Answer : C
11. Under Button Click the following code is written
1. Dim I =10
2. MsgBox(I)

A. Problem is in line 1
B. Problem is in line 2
C. Will display 10 in a message box
D. Compilation Error
Answer : C
12. ____________ enables you to add, modify and delete records but you won't see the changes made by other users
A. OpenForwardOnly
B. OpenKeyset
C. OpenDynamic
D. OpenStatic
Answer : B
13. How do you get information from a form that is submitted using the "post" method?
A. Request.QueryString
B. Request.Form
C. Response.write
D. Response.writeln
Answer : B
14. _________ object represents all information sent form a server to a browser
A. Response
B. Request
C. Session
D. Application
Answer : A
15. ASP.NET uses _______ as the code behind
A. VB
B. VBScript
C. JavaScript
D. Jscript
Answer : A
16. How do we create a FileSystemObject?
A. Server.CreateObject("Scripting.FileSystemObject")
B. Create("FileSystemObject")
C. Create Object:"Scripting.FileSystemObject"
D. Server.CreateObject("FileSystemObject")
Answer : A
17. HTML tag equivalent to Panel is
A. Div
B. Br
C. P
D. Span
Answer : A
18. __________ 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
19. While accessing values submitted to a web form, __________ property of a control is used.
A. Value
B. Text
C. Item
D. Id
Answer : A
20. 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
21. There can be more than one Global.asax file
A. True
B. False
C.
D.
Answer : B
22. If someone accidentally deletes the Page Directive of an ASP.NET page say "First.aspx" under "Sales", what will you do?
A. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" Inherits="FirstQuarter"%>
B. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" ClassName="Sales.FirstQuarter"%>
C. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" Inherits="Sales.FirstQuarter"%>
D. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" ClassName="Sales.FirstQuarter" Inherits="FirstQuarter"%>
Answer : C
23. CDONTS is designed on for Windows NT Server
A. True
B. False
C.
D.
Answer : A
24. _________ is used to write/read into a leaf node
A. Value
B. InnerText
C. Text
D. InnerValue
Answer : B
25. Difference between Response.Write() andResponse.Output.Write().
A. Response.Output.Write() allows you to buffer output
B. Response.Output.Write() allows you to write formatted output
C. Response.Output.Write() allows you to flush output
D. Response.Output.Write() allows you to stream output
Answer : B
26. Can you have more than one form declaration on a web form?
A. Yes
B. No
C.
D.
Answer : B
27. If a Table controls name is Table1, to access value from its second row, third column, __________________ can be used.
A. table1.rows(1).cells(2).text
B. table1.rows(2).cells(3).text
C. table1.rows(1).cells(2).value
D. table1.rows(2).cells(3).value
Answer : A
28. .DirectoryInfo gives information about any Directory
A. True
B. False
C.
D.
Answer : B
29. 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
30. Cookies collection is present in
A. Response and Request
B. Request and Server
C. Response and Server
D. All of the above
Answer : A
31. In case of RangeValidator, a TextBox's value can be compared to the values taken from two other TextBoxes
A. True
B. False
C.
D.
Answer : A
32. In ___________ records are read-only and cannot be changed.
A. LockReadOnly
B. LockPessimistic
C. LockOptimistic
D. LockDynamic
Answer : A
33. The HTML control that helps to browse a file is
A. File
B. FileBrowser
C. Browser
D. Select
Answer : A
34. ASP.NET if fully compatible with ASP
A. True
B. False
C.
D.
Answer : B
35. ASP.NET supports all data types that VB.NET supports
A. True
B. False
C.
D.
Answer : A
36. What are unique properties of RangeValidator control?
A. Maximum value
B. Minimum value
C. Type
D. All of the above
Answer : D
37. One difference between ASP.NET and ASP is that ASP is more structure than ASP.NET
A. True
B. False
C.
D.
Answer : B
38. In ASP.NET, the default method of a form is
A. Get
B. Post
C.
D.
Answer : B
39. 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
40. Why is Global.asax is used?
A. Declare Global variables
B. Implement application and session level events
C. No use
D. Both a and b
Answer : B
41. An error handling is Structured when we use
A. On Error GoTo
B. Try Catch
C. Both of the above
D. Any one of the above
Answer : B
42. A web server control is written as
A. <asp-TextBox ......
B. <asp TextBox ......
C. <aspTextBox ........
D. <asp:TextBox ........
Answer : D
43. Checkboxes have same name and different values while Radio Buttons have the reverse
A. True
B. False
C.
D.
Answer : B
44. Can you use client-side event handler and server-side event handler for the same ASP.NET server control?
A. Yes
B. No
C.
D.
Answer : A
45. This file stores your web configuration
A. Web.conf
B. Web.config
C. WebConfig.ini
D. WebConf.ini
Answer : B
46. In the Adrotator XML file ________ is used to mention the file to link to
A. <ImageUrl>
B. <NavigateUrl>
C. <Url>
D. <Link>
Answer : B
47. Which DLL translate XML to SQL in IIS?
A. SQLISAPI.dll
B. SQLXML.dll
C. LISXML.dll
D. SQLIIS.dll
Answer : A
48. To write a root tag say '<details>' through ASP.NET use
A. WriteElement
B. WriteStartElement
C. WriteElementString
D. WriteElementStart
Answer : B
49. 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
50. In ASP.NET if a file is saved, it is save only in the server machine.
A. True
B. False
C.
D.
Answer : A

Sharing is caring