Thứ Tư, 13 tháng 6, 2012

Trắc nghiệm kiến thức cơ bản về Microsoft .NET/ASP .NET

Trong bài này, chúng ta sẽ đến với 50 câu trắc nghiệm về Microsoft .NET/ASP. NET . Với mỗi lựa chọn đúng, các bạn hãy giải thích tại sao lại lựa chọn đáp án đó.

MICROSOFT .NET

1. Who developed .NET ?

a./ Oracle
b./ Microsoft
c./ Wipro
d./ Sun Microsystems

2. What is .NET ?

a./ Database
b./ Programming Language
c./ Operating System
d./ Framework

3. You create 4 forms FormA, FormB, FormC and FormD. You want to allow users to open FormA, FormB and FormC at the same time within FormD. Which properties do you need to set?

a./ IsMdiChild on Forms A,B and C; and IsMdiParent on FormD.
b./ MdiParent on Forms A,B and C; and IsMdiContainer on FormD.
c./ IsMdiChild on Forms A,B and C; and IsMdiContainer on FormD.
d./ MdiParent on Forms A,B and C; and IsMdiParent on FormD.

4. You want to create custom properties for your control, which the user can set using the Properties window of the Visual Studio IDE. What attribute can you use to control the visibility of the properties in the Properties window in the Visual Studio IDE?

a./ DebuggerBrowsable
b./ ComVisible
c./ Browsable
d./ DisplayBrowsable

5. You have added a button named Bt1 to your form, whose Text is “Go”. You want to assign a shortcut to the button, so that whenever a user presses ALT+G, the Click event of the button Bt1 is raised. What code should you use?

a./ Bt1.Text = @”Go”;
b./ Bt1.Text = “&Go”;
c./ Bt1.Text = “&&Go”;
d./ Bt1.Text = “@Go”;

6. You are creating a setup and deployment project for your application. You want to ensure that the .NET Framework 2.0 is installed on the computers of the users who want to install your application. Which deployment editor should you use?

a./ Registry Editor
b/ Launch Conditions Editor
c./ File System Editor
d./ Required Components Editor

7. Which property of the WebBrowser control should you use in order to navigate to a specified URL?

a./ NavigateUrl
b./ DocumentUrl
c./ Url
d./ PageUrl

8. You use a TransactionScope in your application in your application in order to use transaction semantics. What code should you use in order to commit the transaction within the transaction scope?

a./ TransactionScope.Completed = true;
b./ TransactionScope.IsCompleted = true;
c./ TransactionScope.Complete();
d./ TransactionScope.Commit();

9. You add a PrintPreviewDialog ppd1 to your Windows Form, in order for your users to preview the document which they want to print. Which property of ppd1 should you set in order to specify the document to preview?

a./ PreviewDocument
b./ PrintDocument
c./ ActiveDocument
d./ Document

10. You decide to use named parameters in a SqlCommand object in order to execute SQL queries on a database. You have a parameter named “CustomerName”. How do you refer to it within the SQL query text in the SqlCommand object?

a./ “?CustomerName”
b./ “@CustomerName”
c./ “%CustomerName”
d./ “#CustomerName”

11. You have a textbox control on your form. You want to store some custom data associated with that object. This data should not be visible to the user – it is meant for internal use in your application. What code should you use?

a./ Use the Text property.
b./ Use the UserInfo property.
c./ Use the Tag property.
d./ Use the CustomData property.

12. Which function of the SqlCommand object must you use in order to execute an “INSERT” Sql Query?

a./ ExecuteScalar();
b./ ExecuteCommand();
c./ ExecuteReader();
d./ ExecuteNonQuery();

13. You want to access web sites on the internet using HTTP. Which of the classes below can you use?

a./ System.Net.HttpClient
b./ System.Net.WebClient
c./ Sytem.Net.InetClient
d./ System.Net.HttpWebRequest

14. You want to create a reusable control by combining existing Windows Controls in order to use it in various of your applications. What should the base class of your control be?

a./ System.Windows.Forms.UserControl
b./ System.Windows.Forms.Control
c./ System.Windows.Forms.WindowsControl
d./ System.Windows.Forms.Component

15. You have a .xml file, and the corresponding .xsd. Which class should you use to validate the xml against the corresponding schema file?

a./ XmlValidatingReader
b./ XmlDictionaryReader
c./ XmlReader
d./ XmlSchemaReader

16. You dynamically create a TextBox control tb1 in code at runtime. You want to associate an event handler with tb1 that gets fired when the user clicks tb1. What operator will you use to associate the event handling function with the Click event of tb1?

a./ &=
b./ +=
c./ =
d./ |=

17. Your application assemblies need to be installed into the Global Assembly Cache. What deployment strategy should you adopt?

a./ Create a Setup Application
b./ Use XCOPY to copy the files
c./ Create a CAB project
d./ Use ClickOnce.

18. What method of the Xml DOM model will you use to delete a node from an Xml document?

a./ RemoveParent
b./ RemoveSibling
c./ RemoveChild
d./ RemoveNode

19. You have code that executes SQL statements on a database within the context of a SQLTransaction. You want to ensure that no user can perform any updates in the database until your transaction is complete. What IsolationLevel should you use?

a./ ReadCommitted
b./ Chaos
c./ ReadUncommitted
d./ Serializable

20. You want to make your application accessible to physically challenged users. Consider Windows Narrator. When controls receive focus, the Narrator speaks out the information given to it. Which properties does the Narrator speak out for a windows control?

a./ Name
b./ AccessibleName
c./ Description
d./ AccessibleDescription

ASP .NET

1. Which of the following languages can be used to write server side scripting in ASP.NET?

a. C-sharp
b. VB
c. C++
d. a and b

2. When an .aspx page is requested from the web server, the out put will be rendered to browser in following format.

a. HTML
b. XML
c. WML
d. JSP

3. The Asp.net server control, which provides an alternative way of displaying text on web page, is

a. < asp:label >
b. < asp:listitem >
c. < asp:button >

4. The first event to be triggered in an aspx page is.

a. Page_Load()
b. Page_Init()
c. Page_click()

5. Postback occurs in which of the following forms.

a. Winforms
b. HTMLForms
c. Webforms

6. What namespace does the Web page belong in the .NET Framework class hierarchy?

a. System.web.UI.Page
b. System.Windows.Page
c. System.Web.page

7. Which method do you invoke on the Data Adapter control to load your generated dataset?

a. Fill( )
b. ExecuteQuery( )
c. Read( )

8. How do you register a user control?

a. Add Tag prefix, Tag name
b. Add Source, Tag prefix
c. Add Src, Tagprefix, Tagname

9. Which of the following is true?

a. User controls are displayed correctly in the Visual Studio .NET Designer
b. Custom controls are displayed correctly in VS.Net Designer
c. User and Custom controls are displayed correctly in the Visual Studio .NET Designer.

10. To add a custom control to a Web form we have to register with.

a. TagPrefix
b. Name space of the dll that is referenced
c. Assemblyname
d. All of the above

11. Custom Controls are derived from which of the classes

a. System.Web.UI.Webcontrol
b. System.Web.UI.Customcontrol
c. System.Web.UI.Customcontrols.Webcontrol

12. How ASP.Net Different from classic ASP?

a. Scripting is separated from the HTML, Code is interpreted seperately
b. Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server
c. Code is separated from the HTML and interpreted Code is interpreted separately

13. What's the difference between Response.Write() andResponse.Output.Write()?

a. Response.Output.Write() allows you to flush output
b. Response.Output.Write() allows you to buffer output
c. Response.Output.Write() allows you to write formatted output
d. Response.Output.Write() allows you to stream output

14. Why is Global.asax is used?

a. Implement application and session level events
b. Declare Global variables
c. No use

15. There can be more than 1 machine.config file in a system

a. True
b. False

16. What is the extension of a web user control file?

a. .Asmx
b. .Ascx
c. .Aspx

17. Which of the following is true?

a. IsPostBack is a method of System.UI.Web.Page class
b. IsPostBack is a method of System.Web.UI.Page class
c. IsPostBack is a readonly property of System.Web.UI.Page class

18. The number of forms that can be added to a aspx page is.

a. 1
b. 2
c. 3
d. More than 3

19. How do you manage states in asp.net application

a. Session Objects
b. Application Objects
c. Viewstate
d. All of the above

20. Which property of the session object is used to set the local identifier?

a. SessionId
b. LCID
c. Item
d. Key

21. Select the caching type supported by ASP.Net

a. Output Caching
b. DataCaching
c. a and b
d. none of the above

22. Where is the default Session data is stored in ASP.Net?

a. InProcess
b. StateServer
c. Session Object
d. al of the above

23. Select the type Processing model that asp.net simulate

a. Event-driven
b. Static
c. Linear
d. Topdown

24. Does the EnableViewState allows the page to save the users input on a form?

a. Yes
b. No

25. Which DLL translate XML to SQL in IIS?

a. SQLISAPI.dll
b. SQLXML.dll
c. LISXML.dll
d. SQLIIS.dll

26. What is the maximum number of cookies that can be allowed to a web site?

a. 1
b. 10
c. 20
d. More than 30

27. Select the control which does not have any visible interface.

a. Datalist
b. DropdownList
c. Repeater
d. Datagrid

28. How do you explicitly kill a user session?

a. Session.Close( )
b. Session.Discard( )
c. Session.Abandon
d. Session.End
e. Session.Exit

29. Which of the following is not a member of ADODBCommand object?

a. ExecuteReader
b. ExecuteScalar
c. ExecuteStream
d. Open
e. CommandText

30. Which one of the following namespaces contains the definition for IdbConnection?

a. System.Data.Interfaces
b. System.Data.Common
c. System.Data
d. System.Data.Connection

Editor: Vương L. Kiều (Baomathethong.blogspot.com)
Copyrighted Content: N/A

Không có nhận xét nào:

Đăng nhận xét