ASP.NET Core: ASP.NET Quiz


Khóa học qua video:
Lập trình Python All Lập trình C# All SQL Server All Lập trình C All Java PHP HTML5-CSS3-JavaScript
Đăng ký Hội viên
Tất cả các video dành cho hội viên

(nhấn nút 'Result' để biết kết quả)

Q1. Which one of the following standard is used to connect client browsers with web servers?
TCP/IP
HTTP
HTML
ASP.NET

Q2. Which one of the following is used to validate an e-mail address pattern?
Extended expressions
Irregular expressions
Regular expressions
None

Q3. Marshaling is a process of transforming or serializing data from one application domain and exporting it to another application domain.
True
False

Q4. Explain the significance of Server .MapPath
Returns the Virtual Path of the web folder
Maps the specified virtual path to Physical path
Returns the physical file path that corresponds to virtual specified path
All the above

Q5. How can Garbage Collection be forced in .NET?
By using System.GC.Finalize()
By using System.GC.Collect()
By using System.GC.KeepAlive()
By using System.GC.Dispose()

Q6. SQLDataSource can filter the results of a query without re-running the query.
True
False

Q7. What attributes do you use to hide a public .Net class from COM?
DLLImport Attributes
ComVisible attributes
COM Interop
All of the above

Q8. What is the property name of a GridView (or a DataGrid) that regulates the sorting?
Sorting
EnableSorting
DisableSorting
AllowSorting

Q9. Validation events of server controls occur before the page is postback to the server.
True
False

Q10. Which of the following is the default authentication mode for IIS?
Anonymous
Windows
Basic Authentication
None

Q11. Which of the following is true about AutoPostBack property of a server control?
It causes the control to fire postback event.
By default, this property is set to False
Both are true

Q12. Which one of the following control does not have any visible interface?
DropdownList
Datalist
Datagrid
Repeater

Q13. Name the ASP.NET object that is used to get information about the web servers?
The Application object
The Server object
The Response object
The Request object

Q14. _____________ section of the web.config file is used for storing a list of authorized users.
authentication
authorization
a and b
None

Q15. Which one of the following is incorrect about ViewState?
ViewState is used to maintain or retain values on postback
ViewState ensures security because it stores the data in encrypted format
If a ViewState of a certain control has to be disabled, then set EnableViewState="false"
ViewState information automatically transfers from page to page

Q16. ________________ is the validation control used for "PatternMatching"
RegularExpressionValidator
RangeValidator
FieldValidator
PatternValidator

Q17. Attribute that must be set on a validator control for the validation to work.
ControlToValidate
ControlToBind
ValidateControl
Validate

Q18. Mode of storing ASP.NET session
InProc
StateServer
SQL Server
All of the above

Q19. How do you get information from a form that is submitted using the "post" method?
Request.QueryString
Request.Form
Response.write
Response.writeln

Q20. ______________ element in the web.config file is used to run code using the permissions of a specific user
< credential>
< authentication>
< authorization>
< identity>

Q21. Which of the following object is used along with an application object in order to ensure that only one process accesses a variable at a time?
Synchronize
Synchronize()
ThreadLock
Lock()

Q22. An alternative way of displaying text on web page using
asp:label
asp:listitem
asp:button

Q23. Choose the form in which Postback occurs.
HTMLForms
Webforms
Winforms

Q24. The ________________ property affects how the .Net Framework handles dates, currencies, sorting and formatting issues.
CurrentUICulture
CurrentCulture

Q25. Which of the following is faster and consume lesser memory?
SQLDataReader
Data Set

Q26. Which of the following is used to cache multiple responses for a single web form based on HTTP POST parameter or query string?
VaryByParams
VaryByHeaders
SetCacheability
SetVaryByCustom

Q27. Which of the following control is used to validate that two fields are equal?
RegularExpressionValidator
CompareValidator
equals() method
RequiredFieldValidator

Q28. Which of the following ASP.NET object encapsulates the state of the client?
Session object
Application object
Response object
Server object

Q29. Difference between Response.Write() and Response.Output.Write().
Response.Output.Write() allows you to buffer output
Response.Output.Write() allows you to write formatted output
Response.Output.Write() allows you to flush output
Response.Output.Write() allows you to stream output

Q30. Which DLL translates XML to SQL in IIS?
SQLISAPI.dll
SQLXML.dll
LISXML.dll
SQLIIS.dll

Q31. Which of these classes maps to the tag <input type="checkbox"/>
HtmlCheckBox
HtmlInputCheckBox
HtmlControl
None

Q32. Which kind of data can we store in ViewState?
ViewState can store only serializable object
ViewState can store anything
ViewState can store onlys string
None

Q33. Which class can be used to perform data type conversion between .NET data types and XML types?
XmlType
XmlCast
XmlConvert
XmlSettings

Q34. Which of the following is a requirement when merging modified data into a DataSet?
A primary key must be defined on the DataTable objects
The DataSet schemas must match in order to merge
The destination DataSet must be empty prior to merging
A DataSet must be merged into the same DataSet that created it

Q35. Which of the following represents the best use of the Table, TableRow, and Table-Cell controls?
To create and populate a Table in Design view
To create a customized control that needs to display data in a tabular fashion
To create and populate a Table with images
To display a tabular result set

Q36. If I'm developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
Maintain the login state security through a database
Maintain the login state security through a Session
Maintain the login state security through a View State
All of the Above

Q37. We have defined one page_load event in aspx page and same page_load event in code behind Which one will run first?
page_load event in aspx page
page_load event in code-behind
both will run simultaneously
None

Q38. Where can we assign value to static read only member variable of a static class?
Default constructor
Parameterized constructor
Global.asax
On click of button

Q39. In order to prevent a browser from caching a page which of these statements should be written?
Response.Cache.SetNoStore();
Response.Cache.SetNoServerCaching();
Response.Cache.SetNoCaching();
None of these

Q40. An ASP.NET page uses a Datagrid to display employee information.The Web application supports a large number of concurrent users who will be saving data from the grid back to the database. It is important that the Web application doesn't overwhelm the Web Server.
Disable View State and don't use session state
Use View State
Use URL munging
Disable ViewState and use Session State

Q41. Which of these data source controls do not implement Caching?
LinqDataSource
ObjectDataSource
SqlDataSource
XmlDataSource

Q42. Which of these files takes the web application in offline mode?
app_offline.html
app_offline.htm
appoffline.html
None of the above

Q43. _________________object can hold more than one rowset from the same data source and the relationships between them.
DataReader
Dataset
OleDB connection
Data Adapter

Q44. ________________event is fired just before an application is destroyed.
Application_Error
Application_Disposed
Application_End
Application_EndRequest

Q45. __________________ directive informs the compiler of any custom server control added to the page.
Page
Register
OutputCache
Application

Q46. How can we force all the validation control to run?
Set EnableClientScript true
Page.IsValid()
Page.Validate

Q47. Choose the system components that provide access to various system-level events that occurs on the server
Message Queue
EventLog
FileSystemWatcher
All of the above

Q48. Which keyword is used within exception-handling structure to immediately pass control flow to the catch statement?
throw
finally
catch
try

Q49. Which of them is used to monitor the web application after deployment?
MMC Event Viewer
Performance logs
Alerts Snap-ins
All of them

Q50. Limitation of XML serialization
It doesn’t serialize type information
It can't serialize DataSet objects
It can’t serialize XMLNode object
All of the above

Q51. Web services are components that provide functionality via the internet using HTTP protocol.
True
False

Q52. How do we call methods in remoting Asynchronously in .NET?
By using Delegates
By using new keyword
By using pointer
By using Non-default constructors

Q53. In which type of remote object creation mode in .NET, the object is created with every method call thus making the object stateless.
Single call mode
Singleton

Q54. What is the file extension of web services?
.asmx
.aspx
.asax
.dll

Q55. Which of the following is used to club or group common services together on a server and provides links to the schema documents of the services?
WSDL
UDDI
DISCO
URI

Q56. Which of the remoting model is stateful in nature?
Server activated object SAO
Client activated objects CAO

Q57. What types of Objects can you query using LINQ?
DataTables and DataSets
Any .NET Framework collection that implements IEnumerable(T)
Collections that implement interfaces that inherit from IEnumerable(T)
All of the above

Q58. An assembly must have an permission to connect with web server is?
socketPermission
DnsPermission
WebPermission
TCPPermission

Q59. What component do you need to enable for a user to add new web parts?
WebpartZone
CatalogZone
WebPartManager
WebManager

Q60. What is the element of code access security?
Evidence, Permission
SQLSecurity
UserInterface
SQL Injection

Q61. A write-only property can be specified if the following is present.
The set modifier only
The get modifier only
Both the modifiers
None of the modifiers

Q62. If you want to access a web service method ,which attribute it must have?
[WebMethod]
[PageMetod]
[Web.Service]
[WebSupport]

Q63. What LINQ expressions are used to shape results in a query?
1.where
2.select
3.join
4.group
2, 4
1, 2
3, 4
None

Q64. Which of the following is true?
DataTable object contain DataRow and DataColoumn objects
DataSet and DataTable can be binary serialized
DataSet and DataTable can be XML serialized
All of the above

Q65. An UpdatePanel control defined on a page. Button control is placed outside of the UpdatePanel .How to cause the UpdatePanel to execute an update.
Set the Trigger attribute of the UpdatePanel to the ID of the Button control.
Set the AsyncPostBackTrigger attribute of the Button control to the ID of the UpdatePanel.
Place the button control on the update panel without script manager.
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.

Q66. The best way for handling exception when dealing with a database connection?
Implement a try/catch block that catches System.Exceptions.
Implementing custom error page.
Implement a try/catch block that catches individual exception types, such as SQLException.
Display an error message.

Q67. Which interface defines the basic extension methods for LINQ?
IComparable< T>
IList
IEnumerable
IQueryable< T>

Q68. Which of the following is true?
1.AJAX is a platform-independent technology
2.AJAX can work with web application
3.AJAX can only work with ASP.NET
4.AJAX is a platform-dependent technology
1, 2
1, 2, 3
1, 3, 4
None

Q69. What types of shapes can LINQ query results be shaped into?
1.Collections of primitive types
2.Collections of complex types
3.Single types
4.Collections of anonymous types
1, 2, 4
1, 2, 3
1, 3, 4
None

Q70. What are the Command object property settings to execute a stored procedure?
1. CommandType = Text, CommandText = stored procedure name
2. CommandType = Text, CommandText = SQL syntax to execute the stored procedure
3. CommandType = StoredProcedure, CommandText = SQL syntax to execute the stored procedure
4. CommandType = StoredProcedure, CommandText = stored procedure name
1, 2
1, 2, 3
2, 4
1, 4

Q71. What happens when you call the Close method of a connection object?
1. The connection is destroyed.
2. The connection is returned to the connection pool.
3. The StateChange event is fired.
4. All noncommitted pending transactions are rolled back.
1, 2
1, 2, 3
1, 3
2, 3, 4

Q72. How do you execute multiple SQL statements using a DataReader?
Call the ExecuteReader method of two Command objects and assign the results to the same instance of a DataReader.
Call the ExecuteReader method of a single Command object twice.
Set the Command.CommandText property to multiple SQL statements delimited by a semicolon.
Set the Command.CommandType property to multiple result sets.

Q73. What data types do the Range Validator control support?
Integer
String
Currency
All of the above

Q74. What should you do to access the returned tabular data after starting execution of a command that runs asynchronously? (Choose all that apply.)
1. Call the EndExecuteNonQuery method.
2. Call the EndExecuteReader method.
3. Wait for the StatementCompleted event to fire and iterate through the DataReader.
4. Wait for the StatementCompleted event to fire, call the EndExecuteReader method,and then iterate through the DataReader.
1, 2
1, 2, 3
2, 3
2, 4

Q75. Choose the correct one
XML serialization serializes the public fields and properties of an object
XML serialization serializes the private fields and properties of an object
XML serialization serializes only the public methods
None

Q76. Your company uses Visual Studio .NET as its application development platform. You have recently finished development of a class named ShopList using the .NET Framework. The class will include ShopItem objects that have the public properties exhibit below: 1. Name 2. ID 3. DiscountCode You need to enable users of the class to iterate through the ShopList collection, and to list each product's name and ID using the foreach statement. Which of the following code segments will you use to accomplish this task?
public class ShopList : IEnumerator, IEnumerable { // Class implementation }
public class ShopList : IBindingList { // Class implementation }
public class ShopList : IDictionary { // Class implementation }
public class ShopList : ICollection { // Class implementation }

Q77. From a dataview dv who has a column “EmpNo” from employee table, how will u bind a textbox
Textbox.databinding.add(“Text”,dv,”EmpNo”);
Textbox.databinding.adddv,”EmpNo”);
Textbox.databinding.add(EmpNo”);
None of the above

Q78. The fundamental requirement of dependency injection is
Passing service to the client
Allowing client to find service
Allowing client to build service
Giving the client part service

Q79. In dependency injection using values within new and static methods is
Important
Prohibited
Allowed
Required

Q80. Dependency injection can described as a form of
Automated control
Inversion control
Total control
Direct control

Q81. Dependency Injection supports which of these principles?
Dependency rare principle
Dependency new principle
Dependency total principle
Dependency inversion principle

Q82. All of the following are means upon which a client accepts a dependency injection except
Constructor-based injection
Client-based injection
Setter-based injection
Interface-based injection

Q83. The basic unit of dependency injection is
Injection
Codes
Variables
Service

Q84. Dependency Injection usually involves how many roles?
2
3
4
5

Q85. Concerning  dependency injection which of these is odd?
Service object
Client object
Client code
Injector

Q86. An object that can be used in dependency injection is regarded as
Injector
Client
Code
Service

Q87. An object that use other objects in dependency injection is
Client
Service
Injector
Command

Q88. Which of the following classes is used to encapsulate IP address and DNS?
ContentHandler
InetAddress
URL
DatagramPacket

Q89. Which of the following are the protocols defined by .NET runtime?
FTP
HTTP
HTTPS
All of the above

Q90. What exception is thrown if the URI format is invalid?
UriFormatException
MalformedURLException
URLSourceNotFound
URLNotFound

Q91. What exception is thrown if the protocol supported by URI prefix is invalid?
UriFormatException
URLNotFound
URLSourceNotFound
NotSupportedException

Q92. What exception is thrown if the user does not have a proper authorization?
URLSourceNotFound
URLNotFound
System.Security.SecurityException
All of the above

Q93. Choose the exceptions generated by the Create() method defined by WebRequest
ArgumentNullException
NotSupportedException
System.Security.SecurityException
All of the above

Q94. Choose the exceptions generated by the GetReponse() method defined by WebRequest
WebException
InvalidOperationException
ProtocolViolationException
All of the above

Q95. Select the two properties related to the network errors generated by WebException
Status
Response
All of the above
None of the above

Q96. Which of these classes is used for operating on the request from the client to the server?
httpd
httpConnection
httpDecoder
http

Q97. Choose the exceptions generated by the GetResponseStream() method defined by WebRequest
IOException
ProtocolViolationException
ObjectDisposedException
All of the above

Q98. Which of these classes is used to create servers that listen to either local or remote client programs?
HttpResponse
MimeHeader
ServerSockets
httpServer

Q99. Which of these methods gives the full URL of an URL object?
toExternalForm()
fullHost()
getHost()
AbsoluteUri()

Q100. What does URL stand for?
Universal Resource Latch
Universal Resource Locator
Uniform Resource Latch
Uniform Resource Locator

Q101. Which of these exceptions is thrown by the URL class constructors?
URLNotFoundException
URLNotFound
URLSourceNotFound
MalformedURLException

Q102. Which of these data members of HttpResponse class is used to store the response from a http server?
statusCode
statusResponse
address
status

Q103. Which of these keywords are used to implement synchronization?
synchronized
synchronize
syn
synch

Q104. Which keyword is used for using the synchronization features defined by the Monitor class?
locked
Monitor
synchronized
lock

Q105. What is synchronization in reference to a thread?
Its a method that allow to many threads to access any information the require
Its a process by which a method is able to access many different threads simultaneously
Its a process by which many thread are able to access same shared resource simultaneously
Its a process of handling situations when two or more threads need access to a shared resource

Q106. What kind of exception is being thrown if Wait(), Pulse() or PulseAll() is called from code that is not within synchronized code?
SynchronizationLockException
System I/O Exception
DivideByZero Exception
All of the above

Q107. What is Semaphore?
Make use of a counter to control access to a shared resource
Grant more than one thread access to a shared resource at the same time
Useful when a collection of resources is being synchronized
All of the above

Q108. Which of the following are the interfaces defined by the namespace System.Net?
WebRequestCreate
IAuthenticationModule
None of the above
All of the above

Q109. Which of the following are the classes that support the standard HTTP protocol?
HttpWebRequest
HttpWebResponse
All of the above
None of the above

Q110. Which of the following class/classes supports the task of uploading and downloading the file?
WebClient
WebRequest
WebResponse
All of the above

Q111. How many ports of TCP/IP are reserved for specific protocols?
1024
512
2048
None of the above

(Ghi chú: Phần câu hỏi Qi có màu Green thể hiện đáp án đúng)

(Ghi chú: Phần câu hỏi Qi có màu Green thể hiện đáp án đúng)
» Tiếp: Razor Pages với Entity Framework Core trong ASP.NET Core - Hướng dẫn 1/8
« Trước: Xác thực và ủy quyền trong ASP.NET Core SignalR
Khóa học qua video:
Lập trình Python All Lập trình C# All SQL Server All Lập trình C All Java PHP HTML5-CSS3-JavaScript
Đăng ký Hội viên
Tất cả các video dành cho hội viên
Copied !!!