Olete.in
Articles
Mock Tests
🧪 ASP.Net MCQ Quiz Hub
ASP.Net Mcq Question Set 2
Choose a topic to test your knowledge and improve your ASP.Net skills
1. _____is a property common in every validation control.
ValidationExpression
InitialValue
ValueToCompare
ControlToValidate
2. Using which type of stylesheet we can change the style of an element in the entire website?
Internal Stylesheet
External Stylesheet
Inline stylesheet
None of above
3. Which of the following is the way to monitor the web application?
MMC Event viewers
Performance logs
Alerts Snap-ins
ALL
4. ______ file apply settings to all ASP.NET applications
web.config
machine.config
global.asax file
application object
5. Which type of processing model does asp.net stimulate?
Static
Linear
Bottom up
Event-driven
6. Which protocol is used for requesting a web page in ASP.NET from the Web Server?
HTTP
TCP
SMTP
None of the above.
7. What is the fully qualified name of the base class of all server controls?
System.Web.UI.Control
System.Web.UI
System.Control
All of the above
8. Which file you should write for the connection string, so that you can access it in all the web pages for the same application?
In App_Data folder
In Web.config file
In MasterPage file
none of the above
9. Which of the following control provides a link for unauthenticated users to log on?
Login
LoginView
LoginStatus
LoginName
10. What are the advantages of AJAX?
AJAX is a platform-independent technology
It provides partial-page updates
Improved performance
All of the above
11. If you want to cache the page according to the browser, then what will you do?
Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=”none” VaryByCustom=”browser” %>
Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=”none” VaryByHeader=”browser” %>
Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=” browser” VaryByCustom=”none” %>
None of the above.
12. You need to allow users to choose their own themes. In which page event will you write the user-selected theme?
Page_Load
Page_Render
Page_PreInit
Page_PreRender
13. Client-side validation is turned on by default. If you want that particular validation control should not validate at client side, what will you do?
Set the EnableClientScript property to false
Set the validate property to false
Set the EnableClientScript property to true
Set the Page.Isvalid property to false
14. A button control is located outside the UpdatePanel control. You need that a given button control outside of the UpdatePanel should cause the UpdatePanel to execute an update with partial update. What will you do to achieve this task?
Add a PostBackTrigger control to the Triggers section of the UpdatePanel. - Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
Add a Trigger control to the Triggers section of the UpdatePanel. - Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel. - Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
None of the above.
15. Which is the first event of ASP.NET page, when user requests a web page ?
PreLoad
Load
Preinit
Init
16. Which one of the following HTTP verbs indicates that you are creating and writing a file on the Web server?
POST
SET
GET
PUT
17. Which attribute is necessary for HTML control to work as a HTML server control?
runat=”server”
runat=”web-server”
ID=”server”
ID=”web-server”
18. MARS feature is disabled by default. What action you will perform in connection string to enable this feature?
Set MultipleActiveResultSets=True"
Set MultipleResultSets=true"
Set ResultSets=True"
None of the above.
19. Which control can be used to update only the portion of the page?
UpdatePanel
ScriptManager
AsyncPostBackTrigger
None of the above.
20. Which is the mandatory property for all validation controls?
ControlToValidate
Message
EnableClientScript
EnableServerScript
21. Which object works on client side in state management system?
ViewState
cookies
Query strings
All of the above
22. How many types of caching ASP.NET supports?
Page Output Caching
Partial Page Caching
Data Caching
All of the above.
23. If a user wants to create controls at runtime which event should be used to write code?
PreLoad
Load
Init
PreInit
24. How will you add a TextBox control at runtime on the form? Choose the correct one.
extBox obj = new TextBox(); obj.ID = "txtUserName"; form1.Controls.Add(obj);
form1.Controls.Add(TextBox);
this.FindControl.add(TextBox);
None of the above.
25. You are creating an ASP.NET application for company CareerRide. You use form based authentication to validate users. You need to prevent unauthenticated users from accessing the application. What should you do?
In the authorization section of the Web.config file, set the users attribute of the deny element to “?”
Set In the authorization section of the Web.config file, set the users attribute of the deny element to “*”
In the authorization section of the Machine.config file, set the users attribute to the allow element to “?”.
None of the above.
26. What is the use of VaryByParam attribute in OutputCache directive?
You can neglect VaryByParam attribute while using Page output caching.
The VaryByParam attribute determines which versions of the page output are actually cached.
The VaryByParam attribute determines which web page is cached in database.
None of the above.
27. Which control is required inside a content page to reference ContentPlaceHolder control inside the master page?
Content control on a content page.
ContentPlaceHolder on a content page.
PlaceHolder control is required on content page.
None of the above.
28. At which level Theme can be applied?
Page level
Site level (through the Web.config file)
Individual control level
All of the above.
29. When user request a web page by entering Uniform Resource Locator (URL) then which method /verb/command is used in ASP.NET?
POST
SET
GET
All of the above.
30. HTTP messages are typically sent between the Web server and Web browser using which Port number?
70
80
400
410
31. What type of data can Cookies store?
String
DateTime
System.Int32
None of the above.
32. What are the different types of Session Mode in ASP.NET?
InProc
StateServer
SQLServer
All of the above
33. Which validation control in ASP.NET can be used to determine if the data is entered into a TextBox control is of type Currency?
ValidationSummary
CompareValidator
RequiredFieldValidator
None of the above.
34. CompareValidator control can be used for performing which task?
To perform a data type check.
To compare the value entered into a form field against a fixed value.
To compare the value of one form field against another.
All of the above.
35. Match the following List 1 to List 2 a. Client-side navigation ---------------------- i. Server.Transfer b. Cross-page posting ------------------------- ii. Response.Redirect c. Client-side browser redirects ------------- iii. PostBackUrl d. Server-side transfer ------------------------- iv. HyperLink
a-iv, b-iii, c-ii, d-i
a-ii, b-iv, c-i, d-iii
a-ii, b-i, c-iii, d-iv
a-ii, b-iv, c-iii, d-i
36. You want to enable Page Output Caching in ASP.NET. What code you will write in ASPX page.
<%@ OutputCache Duration="30" VaryByParam="none" %>
<%@ OutputCache VaryByParam="none" %>
<%@ OutputCache Duration="30" %>
None of the above.
37. Choose the correct option according to given statements. Statement 1: Authentication is the process that determines the identity of a user. Statement 2: Authorization is the process of determining whether a user is permitted to access to any part of an application, or any particular resource. Statement 3: Authorization is the process that determines the identity of a user. Statement 4: Authentication is the process of determining whether a user is permitted access to any part of an application, or any particular resource.
Statement 1 and Statement 2 are correct.
Statement 3 and Statement 4 are correct.
Statement 1 and Statement 3 are correct.
Statement 2 and Statement 4 are correct.
38. What are the three main objects of DataSet?
DataTable, DataColumn, and type.
DataTable, DataRelation, and DataAdapter.
DataTable, DataColumn, and DataRelation.
DataReader,DataAdapter, and Command.
39. On what object would you set the properties to create a primary key for a DataTable?
DataRelation
DataColumn
DataSet
DataTable
40. How many 'ScriptManager' control can be added on a ASP.NET web page?
Only One
More than One
Only Two
None of the above.
41. Which property and method of the Page object do you use to register client script dynamically from code?
ScriptManager control is used to dynamically register client script from code.
The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.
ScriptManagerProxy control is used to dynamically register client script from code.
None of the above.
42. Match the following List 1 to List 2 a. Web Form -------------------------- i. .ascx b. Web User Control ---------------- ii. .asmx c. Web Service ---------------------- iii. .aspx
a-iii, b-i, c-ii
a-ii , b-i, c-iii
a-i, b-ii, c-iii
None of the mentioned
43. To create your application on a remote server which option you will choose in ASP.NET?
File System
FTP
HTTPS
None of the above.
44. What is Multiple Active Result Sets (MARS)?
It allows execution of multiple batches against Database on a single connection.
New feature of SQL SERVER 2005. Previous version of SQL Server does not support this feature.
Option A and B are correct.
None of the above.
45. Which Data Provider gives the maximum performance when connect to SQL Server?
The SqlClient data provider.
The OLE DB data provider.
The Oracle data provider
All of the above.
46. What are the client-side state management options that ASP.NET supports?
Application
Session
Querystring
Option A and B are correct.
47. Which Session Mode stores session Information in Current Application Domain?
InProc
StateServer
SQLServer
Off
48. By default, when you use Page Output Caching, at what location page is cached?
Only on web server
Only on Client
Web server, any proxy servers, and browser
All of the above.
49. Debug class is available in which namespace?
System.Debug
System.Data
System.Diagnostics
None of the above
50. Match the following List 1 to List 2 a. Literal Control ----------------- i. SingleLine, MultiLine, Password b. Label Control ------------------ ii. CommandName c. TextBox Control -------------- iii. Convert to span tag in HTML d. Button Control ---------------- iv. PassThrough, Encode, Transform mode
a-iv, b-iii, c-ii, d-i
a-ii, b-iv, c-i, d-iii
a-ii, b-i, c-iii, d-iv
a-iv, b-iii, c-i, d-ii
Submit