.NET Framework Development Quiz - ASP.NET and Windows Forms

Test your knowledge of Microsoft .NET Framework development, including ASP.NET web development, Windows Forms desktop applications, ADO.NET data access, deployment strategies, and .NET configuration.

19 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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?

  1. IsMdiChild on Forms A,B and C; and IsMdiParent on FormD.
  2. MdiParent on Forms A,B and C; and IsMdiContainer on FormD.
  3. IsMdiChild on Forms A,B and C; and IsMdiContainer on FormD.
  4. MdiParent on Forms A,B and C; and IsMdiParent on FormD.
Question 2 Multiple Choice (Single Answer)

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?

  1. DebuggerBrowsable
  2. ComVisible
  3. Browsable
  4. DisplayBrowsable
Question 3 Multiple Choice (Single Answer)

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?

  1. Bt1.Text = @”Go”;
  2. Bt1.Text = “&Go”;
  3. Bt1.Text = “&&Go”;
  4. Bt1.Text = “@Go”;
Question 4 Multiple Choice (Single Answer)

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?

  1. Registry Editor
  2. Launch Conditions Editor
  3. File System Editor
  4. Required Components Editor
Question 5 Multiple Choice (Single Answer)

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?

  1. TransactionScope.Completed = true;
  2. TransactionScope.IsCompleted = true;
  3. TransactionScope.Complete();
  4. TransactionScope.Commit();
Question 6 Multiple Choice (Single Answer)

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?

  1. “?CustomerName”
  2. “@CustomerName”
  3. “%CustomerName”
  4. “#CustomerName”
Question 7 Multiple Choice (Single Answer)

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

  1. XmlValidatingReader
  2. XmlDictionaryReader
  3. XmlReader
  4. XmlSchemaReader
Question 8 Multiple Choice (Single Answer)

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

  1. Create a Setup Application
  2. Use XCOPY to copy the files
  3. Create a CAB project
  4. Use ClickOnce.
Question 9 Multiple Choice (Single Answer)

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?

  1. System.Windows.Forms.UserControl
  2. System.Windows.Forms.Control
  3. System.Windows.Forms.WindowsControl
  4. System.Windows.Forms.Component
Question 10 Multiple Choice (Single Answer)

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

  1. System.Net.HttpClient
  2. System.Net.WebClient
  3. Sytem.Net.InetClient
  4. Sytem.Net.SoapClient
Question 11 Multiple Choice (Single Answer)

What is the Web.config file used for ?

  1. To store the global information and variable definitions for the application
  2. Configures the time that the server-side codebehind module is called
  3. To configure the web server
  4. To configure the web browser
Question 12 Multiple Choice (Single Answer)

After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be ?

  1. The AutoEventWireup attribute is set to False
  2. The AutomaticPostBack attribute is set to False
  3. The codebehind module is not properly compiled
  4. The ListBox must be defined WithEvents
Question 13 Multiple Choice (Single Answer)

When an ASP.NET server control is added to a Web Form, Visual Studio .NET adds one item to the class for the form. What item is added ?

  1. The event registration
  2. A protected class member for the control
  3. A default event handler for the click event
  4. A default class that inherits from the control’s base class
Question 14 Multiple Choice (Single Answer)

What attribute must be set on a validator control for the validation to work ?

  1. Validate
  2. ValidateControl
  3. ControlToBind
  4. ControlToValidate
Question 15 Multiple Choice (Single Answer)

In ASP.NET if one uses windows authentication the current request attaches an object called as

  1. Serialization
  2. WindowsPrincipal
  3. WindowsDataset
  4. None of above
Question 16 Multiple Choice (Single Answer)

Given an ASP.NET Web Form called WebForm1, what class does the WebForm1 class inherit from by default ?

  1. System.Web.Form
  2. System.Web.GUI.Page
  3. System.Web.UI.Page
  4. System.Web.UI.Form
Question 17 Multiple Choice (Single Answer)

What method must be overridden in a custom control ?

  1. The Paint() method
  2. The Control_Build() method
  3. The Render() method
  4. The default constructor
Question 18 Multiple Choice (Single Answer)

The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is

  1. @OutputCache
  2. @CacheOutput
  3. @PageCache
  4. @CacheAll
Question 19 Multiple Choice (Single Answer)

What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time ?

  1. Synchronize()
  2. Lock() and UnLock()
  3. Lock()
  4. Asynchroize()