You are developing a Web form to display wether information. On the initial
requests to the Web form, you need to do some initialization that will changed the
appearance of the form and assign values to some controls. However, this initialization
should not be repeated again when the user submits the Web form. How should you write
the code to accomplish this?
A -
Execute the initialization code only when the Page.IsPostBack property is true. Write the code inside the Page_Load() event handler.
B -
Execute initialization only when the Page.IsPostBack property is true. Write the code inside the Page_Init() event handler.
C -
Write the code inside the Page_Init() event handler. Write the code inside the Page_Load() event handler.
D -
Write the code inside the Page_Load() event handler. Execute the initialization code only when the Page.IsPostBack property is true.
2-
You are a .NET developer for a large warehousing company and need to
develop a Web application that helps users manage the inventory. Inventory data is stored
in a SQL Server 2000 database named WareHouse2 in a database named Inventory. You
use the Sqlconnection object and Windows Integrated authentication to connect to the
Inventory database.
Which of the following connection strings should you choose in your Visual C# .NET
program?
A -
"Provider = SQLOLEDB: Data Source=WarelHouse2: Initial Catalog=Inventory: Integrated Secutity=SSPI:"
"Data Source=WareHouse2: User Id=sa: Password=Ti7uikGf1: Initial Catalog = inventory:"
D -
"Provider = SQLOLEDB: Data Source=WarelHouse2: Initial Catalog=Inventory: User Id=sa; Password=Ti7uGf1:"
3-
You are using a DropDownList Web server control on a Web page that allows
users to select a country name. Based on the users selection of country, you want display
the drop-down list showing states in the selected country and several other country-
specific fields. You dont want users to click a button to submit country information to
the Web server. All your users have JavaScript-enabled browsers. You want to write a
minimum of code; which of the following techniques would use?
A -
Write client-side code in JavaScript to cause a postback when the user selects the country.
B -
Set the AutoPostBack property to true.
C -
Set the AutoEventWireup attribute to true.
D -
Use an HTML server control instead of Web server controls.
4-
You are developing a Web application. The Web application uses a GridView
control to display data. You build your Web Forms for the Web application by dragging
and dropping tables from the Data Connections tree in Server Explorer. You need to add
a connection to your data by using the Add Connection dialog box as shown in the
exhibit. During the process, you need to configure the .NET Data Provider that you use to
create the data source objects.
What should you do?
A -
Click the Change button, and change the data provider for the selected data source
B -
Click the Advance button, and change the Data Source property to the target provider
C -
Click the Advance button, and change the Application Name property to the target provider
D -
Right-click the connection, and click Properties. Modify the Provider property of the data connection
5-
You are a developer for a paper shipping company. You are developing a new
Internet site to provide pricing information to customers.
You have been asked to make sure that the site doesnt require customers to allow
cookies to maintain state.
How do you need to set the Web.config file to allow for this?
A -
<add cookies= "false"/>
B -
<state useCookies= "false"/>
C -
<cookies use= "false"/>
D -
<sessionState cookieless= "true"/>
6-
You are currently developing a file access assembly for your companys Web
site. One of the methods in the assembly is called "GetFile", which has a string filepath
parameter and returns a StreamReader.
You need to raise an IOException if an invalid path is specified in the filepath parameter.
How do you raise the exception in youe coder?
A -
raise new IOException("Invalid path"):
B -
IOException. Throw("Invalid path"):
C -
throw newIOException("Invalid path"):
D -
IOException exception = new IOException("Invalid path"):
7-
You are creating an ASP.NET page for HUI. You create a DataGrid control that
displays past purchases made by the user. The DataGrid control is populated from an
existing database when the page is created.
The page contains TextBox controls that allow users to update their personal information,
such as address and telephone number.
You need to ensure that the page is refreshed as quickly as possible when users update
their contact information.
What should you do?
A -
Set the EnableViewState property of the DataGrid to false.
B -
Set the Enable property of the DataGrid control to false.
C -
Write in the Page.Load event handler that populates the DataGrid control only when IsPostBack property of the page is true.
D -
Set the Help Text property for each control to the desired text.
8-
You are a developer working on a survey application. This application thandles
multiple selections in the form of check boxes. The client has recently reviewed the site
and is impressed. His one comment on the site was that each checkbox needs more than
just the label next to the control to clarify the meaning of checking each checkbox.
You need to add this clarification as qiuckly as possible. What is the best way to
accomplish this?
A -
Set the ToolTip property for each control to the desired text.
B -
Set the Help Text property for each control to the desired text.
C -
Create a Help HTML page.Add a button to the page that displays the Help page in a new window when the user clicks on the button.
D -
Set the EnableViewState property of the DataGrid to false.
9-
You are a developer working a Human resources management application This
application allows HR and Management to view employment contracts including salary
and benefits details.
You have been assigned to fix a bug on the login screen. When a user logs in by typing in
the user name and password, the password appears as clear text rather then as an asterisk
(*) for each chareacter entered.
How would you accomplish this using Web controls?
A -
Change the type of control from <asp:textbox> to <asp:password>.
B -
There isnt an asp.net control for this circumstance.
C -
Change the TextMode property of the password TextBox to Password.
D -
Change the DropDownList to an ArrayList control and set the SelectionMode to Multiple.
10-
You are a developer working on a content management application. When users
submit a piece of content they are required to classify it by selecting its type from a
dropdown list.
In the next version of the application it has been determined that the users will be allowed
to select multiple classifications from the list for each piece of content.
How would change the DropDownList to support this functionality?
A -
Replace the DropDownList with a Listbox control and set the SelectionMode to Multiple.
B -
Change the DropDownList to an ArrayList control and set the SelectionMode to Multiple.
C -
Set the DataSource property and call the DataBind method of the DataGrid control in the Click event handler for the Button control.
D -
Set AutoPostBack of the DropDownList to true. Write code so that when the user makes a selection and the control posts back to the server another copy of the drop down list is generated and placed on the page below the first.