1.You are creating an ASP.NET application for your company's intranet. Employees will use this application to schedule conference rooms for meetings. The scheduling page includes a Calendar control that employees can use to choose a date to reserve a room. The Calendar control is defined as follows: <asp:calendar id="WorkDays" runat="server" OnDayRender="WorkDays_DayRender"/> You want to display a message that reads "Staff Meeting" below every Friday displayed in the calendar. You also want to find all the weekdays for the current month displayed in the calendar and show them with a yellow highlight. You are writing code for the WorkDays.DayRender event handler to perform these tasks. You write the following code. (Line numbers are included for reference only.) 1 Sub WorkDays_DayRender(sender As Object, _ e As DayRenderEventArgs) 2 3 End Sub Which code should you add at line 2 of the event handler? A: If e.Day.Date.DayOfWeek = _DayOfWeek.Friday Thene.Cell.Controls.Add( _New LiteralControl("Staff Meeting"))End IfIf Not e.Day.IsWeekend Thene.Cell.BackColor = _System.Drawing.Color.YellowEnd IfB: If e.Day.Date.Day = 6 _And e.Day.IsOtherMonth Thene.Cell.Controls.Add( _New LiteralControl("Staff Meeting"))e.Cell.BackColor = _System.Drawing.Color.YellowEnd IfC: If e.Day.Date.Day = 6 Thene.Cell.Controls.Add( _New LiteralControl("Staff Meeting"))End IfIf Not e.Day.IsWeekend And Not _e.Day.IsOtherMonth Thene.Cell.BackColor = _System.Drawing.Color.YellowEnd IfD: If e.Day.Date.DayOfWeek = _DayOfWeek.Friday Thene.Cell.Controls.Add( _New LiteralControl("Staff Meeting"))End IfIf Not e.Day.IsWeekend And Not _e.Day.IsOtherMonth Thene.Cell.BackColor = _System.Drawing.Color.YellowEnd IfCorrect Answers: D 2.You are creating an ASP.NET page for the sales department at your company. The page enables users to access data for individual customers by selecting a customer's name. After a customer's name is selected, the page displays a list of that customer's unshipped orders and the total year-to-date (YTD) sales to that customer. Your company's sales data is stored in a Microsoft SQL Server database. You write a stored procedure to return the data that you need to display on the ASP.NET page. The stored procedure returns a result set containing the list of unshipped orders, and it returns the YTD sales in a parameter named @YTD. You write code that uses a SqlCommand object named cmd and a SqlDataReader object named reader to run the stored procedure and return the data. You bind reader to a DataGrid control on your page to display the list of unshipped orders. You want to display the YTD sales in a Label control named ytdLabel. Which code segment should you use? A: reader.NextResult()ytdLabel.Text = cmd.Parameters("@YTD").Value.ToString()reader.Close()B: reader.Close()ytdLabel.Text = reader.NextResult().ToString()C: reader.Close()ytdLabel.Text = cmd.Parameters("@YTD").Value.ToString()D: ytdLabel.Text = cmd.Parameters("@RETURN_VALUE").Value.ToString()reader.Close()Correct Answers: C 3.You create an ASP.NET application for your company's intranet. All employees on the intranet use Internet Explorer. A page named UserAccount.aspx contains several controls that require postbacks to the server for event processing. The event handlers for these controls require access to a database in order to complete their processing. Each time UserAccount.aspx performs a postback, there is a brief period of time in which the browser window is blank while the page is refreshed. The control that had the focus prior to the postback does not have the focus after the page is re-rendered. This factor results in confusion and invalid data entry by some of the users. You need to modify UserAccount.aspx to prevent the browser window from going blank after a postback and to maintain the correct control focus after events are processed. You need to accomplish this task with the minimum amount of development effort. What should you do? A: Add the following attribute to the HTML code for the controls that cause the postbacks:RunAt="client"B: Add the following attribute to the HTML code for the controls that cause the postbacks:EnableViewState="True"C: Add the following attribute to the Page directive for UserAccount.aspx:SmartNavigation="True"D: Add the following attribute to the OutputCache directive for UserAccount.aspx:Location="client"Correct Answers: C 4.You are creating an ASP.NET application for an insurance company. The company will use your ASP.NET application to record insurance claims. Another development team creates a redistributable component that will be used by your ASP.NET application. The component requires several registry entries to be created during installation so that the component will run properly. The same component might be used by other ASP.NET applications in the future. The development team gives you the source code to the component as well as all of the project files for the component. You add the component project to your ASP.NET application. You need to create a deployment package for your application. You want to include the redistributable component with your deployment package. What should you do? A: Create a setup project for the redistributable component.Create a Web setup project for your ASP.NET application.B: Create a merge module project for your ASP.NET application.Create a setup project for the redistributable component and add the merge module for your ASP.NET application to the project.C: Create a merge module project for both your ASP.NET application and the redistributable component.
本新闻共3页,当前在第1页 1 2 3