You are on page 1of 44

Microsoft 70-562

TS: Microsoft .NET Framework 3.5, ASP.NET Application Development


Version: 11.1

Microsoft 70-562 Exam QUESTION NO: 1 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. ABC.com has a server, named ABC-SR13, which runs an instance of Microsoft SQL Server 2005 locally and is configured to make use of Windows Authentication. You have developed a Web application named ABCApp1 that will be hosted on ABC-SR13. You are preparing to configure the role management and membership providers on ABC-SR13. Which of the following actions should you take? A. You should consider making use of the Aspnet_compiler.exe command. B. You should consider making use of the aspnet_regiis.exe command. C. You should consider making use of the Aspnet_merge.exe command D. You should consider making use of the ASP.NET SQL Server registration tool. Answer: A,B Explanation:

QUESTION NO: 2 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have recently developed a Web application named ABCWebApp1, and configured it to make use of Windows Authentication. After specific group is granted NTFS permissions to access a specific file named ABC.doc, you are informed that you have to make sure that users not belonging to the group are prevented from accessing the file. Which of the following actions should you take? A. You should configure the machine.config file to include the <identity impersonate="true"/> element. B. You should configure the machine.config file to include the <authentication mode="[None]"> element. C. You should configure the app.config file to include the <authentication mode="[None]"> element. D. You should configure the Web.config file to include the <identity impersonate="true"/> element. E. You should configure the Web.config file to include the <authentication mode="[None]"> element. "Pass Any Exam. Any Time." - www.actualtests.com 2

Microsoft 70-562 Exam F. You should configure the app.config file to include the <authentication mode="[None]"> element. Answer: D Explanation:

QUESTION NO: 3 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed a web application named ABCWebApp. You are now preparing to configure authentication for ABCWebApp so that clients are not allowed to access it anonymously. You also need to make sure that access for users from untrusted domains are allowed. You have written the code segment shown below: <system.web> <authentication mode="Forms"> <forms loginUrl="login.aspx" /> </authentication> <authorization> <deny users="?" /> </authorization> </system.web> Which of the following actions should you take NEXT? A. You should consider adding the code segment to the web.config file. B. You should consider adding the code segment to the projects property pages. C. You should consider adding the code segment to the app.config file. D. You should consider adding the code segment to the workstations machine.config file. Answer: A

QUESTION NO: 4

"Pass Any Exam. Any Time." - www.actualtests.com

Microsoft 70-562 Exam You work as a Web Developer at ABC.com. An MS ASP.NET Web application, named ABCApp1, has been developed using the 3.5 version of MS Net Framework. Subsequent to retrieving the most recent project version from the source control repository, you try to compile it on your workstation and find that the reference to the assembly is absent. You want to add a reference path that connects to the absent assembly. Which of the following options should you access to achieve this? A. The projects property pages. B. ABCApp1s web.config file. C. ABCApp1s app.config file. D. Your workstations machine.config file. Answer: A Explanation:

QUESTION NO: 5 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop Microsoft ASP.NET Web applications. An existing Web application was developed using Microsoft .NET Framework 1.0. the Web application makes use of Microsoft Internet Information Services (IIS) 6.0, but does not make use of any features of Microsoft .NET Framework 3.5. You want to configure the Web application for .NET Framework 3.5 with as little administrative effort as possible. Which of the following actions should you take? A. You should consider accessing Microsoft Internet Information Services (IIS) 6.0 to modify the handler runtime version. B. You should consider accessing the machine.config file to modify the handler runtime version. C. You should consider accessing the app.config file to modify the handler runtime version. D. You should consider accessing the web.config file to modify the handler runtime version. Answer: A Explanation:

"Pass Any Exam. Any Time." - www.actualtests.com

Microsoft 70-562 Exam QUESTION NO: 6 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have been instructed to develop a Web application that makes use of ASP.NET AJAX. You have also been informed that the application should be installed in ABC.coms Web farm environment. Prior to the deployment, you want to configure SessionState of the new Web application. Which of the following actions should you take? A. You should consider setting the mode attribute of the <sessionState> element to Off. B. You should consider setting the mode attribute of the <sessionState> element to Custom. C. You should consider setting the mode attribute of the <sessionState> element to SQLServer. D. You should consider setting the mode attribute of the <sessionState> element to StateServer. Answer: C Explanation:

QUESTION NO: 7 You work as a Web Developer at ABC.com. You are in the process of creating a Web application using Microsoft ASP.NET 3.5. You host the Web application in Microsoft Internet Information Services (IIS) 6.0. You browse the application and receive a Server Application Unavailable error message. You view the Application event log and discover the following message: It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process. To ensure productivity you need to solve this problem as quick as possible. What should you do? (Choose all that apply) A. You should change the IIS isolation mode. B. You should assign the application to a new application pool. C. You should configure all applications that are part of your application's application pool in order to use the same version of ASP.NET. "Pass Any Exam. Any Time." - www.actualtests.com 5

Microsoft 70-562 Exam D. You should run the Aspnet_regiis.exe Tool. E. You should restart the application pool that hosts the application. Answer: B,C Explanation:

QUESTION NO: 8 You work as a Web Developer at ABC.com. You are in the process of creating a Web application using Microsoft ASP.NET 3.5. You have created an application that includes a Web form file named BookReviews.aspx, which references a LinqDataSource DataSource. The LinqDataSource DataSource is named LinqDataSource1 and has a primary key, named BookID, configured. You have also configured the application to incude a DetailsView control named DetailsView1 You have been instructed to make sure that users are able to insert and update content in the DetailsView1 control. Furthermore, you should make sure that the link button controls for the Edit and New operations are not duplicated. Which of the following actions should you take? You should onir addng the floing code to the BookReviews.aspx: <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource1" AutoGenerateInsertButton="true" /> <Fields> <asp:BoundField DataField="BookID" HeaderText="BookID" InsertVisible="False" ReadOnly="True" SortExpression="BookID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Theater" HeaderText="Theater"

"Pass Any Exam. Any Time." - www.actualtests.com

Microsoft 70-562 Exam SortExpression="Theater" /> <asp:CommandField ShowDeleteButton="false" ShowEditButton="True" ShowInsertButton="True" /> </Fields> </asp:DetailsView> Which code segment should you insert at line 03? A. You should onir addng the floing code to the BookReviews.aspx: <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource1" AutoGenerateRows="false" /> <Fields> <asp:BoundField DataField="BookID" HeaderText="BookID" InsertVisible="False" ReadOnly="True" SortExpression="BookID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Theater" HeaderText="Theater" SortExpression="Theater" /> <asp:CommandField ShowDeleteButton="false" ShowEditButton="True" ShowInsertButton="True" /> </Fields> </asp:DetailsView> B. You should onir addng the floing code to the BookReviews.aspx: <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource1" AllowPaging="true" AutoGenerateRows="false" DataKeyNames="BookID" /> <Fields> <asp:BoundField DataField="BookID" HeaderText="BookID" InsertVisible="False" ReadOnly="True" SortExpression="BookID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Theater" HeaderText="Theater" SortExpression="Theater" /> <asp:CommandField ShowDeleteButton="false" ShowEditButton="True" ShowInsertButton="True" /> </Fields> "Pass Any Exam. Any Time." - www.actualtests.com 7

Microsoft 70-562 Exam </asp:DetailsView> C. You should onir addng the floing code to the BookReviews.aspx: <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource1" DataKeyNames="BookID" /> <Fields> <asp:BoundField DataField="BookID" HeaderText="BookID" InsertVisible="False" ReadOnly="True" SortExpression="BookID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Theater" HeaderText="Theater" SortExpression="Theater" /> <asp:CommandField ShowDeleteButton="false" ShowEditButton="True" ShowInsertButton="True" /> </Fields> </asp:DetailsView> D. You should onir addng the floing code to the BookReviews.aspx: <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource1" AutoGenerateInsertButton="true" /> <Fields> <asp:BoundField DataField="BookID" HeaderText="BookID" InsertVisible="False" ReadOnly="True" SortExpression="BookID" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Theater" HeaderText="Theater" SortExpression="Theater" /> <asp:CommandField ShowDeleteButton="false" ShowEditButton="True" ShowInsertButton="True" /> </Fields> </asp:DetailsView> Answer: B Explanation:

QUESTION NO: 9 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed a Web application named ABCWebApp1, and configured a custom"Pass Any Exam. Any Time." - www.actualtests.com 8

Microsoft 70-562 Exam templated server control named ABCSC that has child controls in the page. Identification of the child controls within the hierarchy of the page should be distinctive. Which of the following actions should you take? A. You should consider applying the GCNotificationStatus Enumeration interface. B. You should consider applying the IDisposable interface. C. You should consider applying the IBindableTemplate interface. D. You should consider applying the INamingContainer interface. E. You should consider applying the IHierarchicalEnumerable interface. Answer: D Explanation:

QUESTION NO: 10 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have written text that includes HTML code, and want to submit it to a page within a newly developed application. You do not want the other applications that are hosted by the Web server to be affected by the successful submission of the HTML code. Which of the following actions should you take? A. You should set the validateRequest attribute of the pages section to true in the machine.config file. B. You should set the validateRequest attribute of the pages section to true in the Web.config file. C. You should set the validateRequest attribute of the pages section to false in the Web.config file. D. You should set the validateRequest attribute of the pages section to false in the machine.config file. Answer: C Explanation:

QUESTION NO: 11 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications.

"Pass Any Exam. Any Time." - www.actualtests.com

Microsoft 70-562 Exam You have developed an application named ABCWebApp7, which consumes an ASMX Web service and is hosted via http://app.ABC.com/beta.asmx. You have been instructed to make sure that, during <system.serviceModel> the setup, client workstations are able to access ABCWebApp7. You start by writing the following code: <client> <endpoint address="http://app.ABC.com/beta.asmx Which of the following options completes the code segment? A. binding="BasicHttpContextBinding" / </client> B. binding="basicHttpBinding" / </client> C. binding="WSFederationHttpBinding" / </client> D. binding="WebHttpBinding" / </client> Answer: B Explanation:

QUESTION NO: 12 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed an application that includes a FormView control. The FormView control is used for accessing the results of a query that has the User, UserName, and UserSurname Fields. You have been instructed to define the control definition for the UserName field in the FormView control so that users have the ability to view and update the field.

"Pass Any Exam. Any Time." - www.actualtests.com

10

Microsoft 70-562 Exam Which of the following actions should you take? A. You should consider making use of the code shown below: <asp:TextBox ID="EditUserNameTextBox" RunAt="Client" Text='<%# Bind("UserName") %>' /> B. You should consider making use of the code shown below: <asp:TextBox ID="EditUserNameTextBox" RunAt="Client" Text='<%# Eval("UserName") %>' /> C. You should consider making use of the code shown below: <asp:TextBox ID="EditUserNameTextBox" RunAt="Server" Text='<%# Bind("UserName") %>' /> D. You should consider making use of the code shown below: <asp:TextBox ID="EditUserNameTextBox" RunAt="Server" Text='<%# Eval("UserName") %>' /> Answer: C Explanation:

QUESTION NO: 13 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed an application that should include an ErrorPage.htm HTML page, as well as a PageNotFound.htm HTML page. You have been instructed to make sure that the PageNotFound.htm page is presented to users when a requested page does not exist. You also have to make sure that the ErrorPage.htm page is presented to users for all other errors. Which of the following actions should you take? A. <customErrors mode="On" defaultRedirect="ErrorPage.htm"> <error statusCode="403" redirect="PageNotFound.htm"/> </customErrors> B. <customErrors mode="On" defaultRedirect="ErrorPage.htm"> <error statusCode="404" redirect="PageNotFound.htm"/> </customErrors> C. <customErrors mode="On"> <error statusCode="401" redirect="ErrorPage.htm"/> <error statusCode="403" redirect="PageNotFound.htm"/> </customErrors> D. <customErrors mode="On"> <error statusCode="400" redirect="ErrorPage.htm"/> <error statusCode="404" redirect="PageNotFound.htm"/> </customErrors>

"Pass Any Exam. Any Time." - www.actualtests.com

11

Microsoft 70-562 Exam Answer: B Explanation:

QUESTION NO: 14 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. ABC.com has a server, named ABC-SR13, which is configured to run Microsoft Internet Information Services (IIS) 6.0. You then configured ABC-SR13 to host a newly developed application, and also have remote debugging enabled. You want to make sure that you are able to debug the application from your workstation which is located in a remote location. Which of the following actions should you take? A. You shouid consider attaching Microsoft Visual Studio.NET to the w3wp.exe process. B. You shouid consider attaching Microsoft Visual Studio.NET to the inetinfo.exe process. C. You shouid consider attaching Microsoft Visual Studio.NET to the aspnet_regiis.exe process. D. You shouid consider attaching Microsoft Visual Studio.NET to the aspnet_wp.exe process. Answer: A Explanation:

QUESTION NO: 15 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of an account named ABCUser1 to log on to the domain via your workstation, which is named ABC-WS07. ABC.com has a server, named ABC-SR13, which has Microsoft Internet Information Services (IIS) 5.0 installed. You make use of Microsoft .NET Framework 3.5 to develop an ASP.NET Web application, and configure it to be hosted on ABC-SR13. You want to make sure that you are able to debug the application remotely.

"Pass Any Exam. Any Time." - www.actualtests.com

12

Microsoft 70-562 Exam Which of the following actions should you take? A. You should consider configuring the use of Form-based for the Remote Debugging Monitor. B. You should consider configuring the use of Passport Authentication for the Remote Debugging Monitor. C. You should consider making the ABCUser1 account a member of the local Administrators group on the ABC-SR13. D. You should consider making the ABCUser1 account a member of the Administrators group on a ABC.com domain controller. Answer: C Explanation:

QUESTION NO: 16 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of Microsoft .NET Framework 3.5 to develop a Microsoft ASP.NET AJAX application. You are then required to debug the JavaScript code in the application. You also want to make sure that the details of the client-side object are displayed by the application on the debugger console. Which of the following actions should you take? A. You should consider making use of the Sys.Debug.fail method. B. You should consider making use of the Debug.trace element. C. You should consider making use of the Sys.Debug clearTrace method. D. You should consider making use of the Sys.Debug.traceDump method. Answer: D Explanation:

QUESTION NO: 17 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of Microsoft .NET Framework 3.5 to develop a Microsoft ASP.NET AJAX application. While testing the application, you find that Microsoft Internet Explorer displays an error icon in the status bar as a result of a JavaScript code segment in the application not performing as it should. "Pass Any Exam. Any Time." - www.actualtests.com 13

Microsoft 70-562 Exam You want to make sure that youi are prompted by Microsoft Internet Explorer to debug the script. Which of the following actions should you take? A. You should consider clearing the Disable Script Debugging (Other) check box, and checking the Display a notification about every script error check box. B. You should consider clearing the Disable Script Debugging (Internet Explorer) check box, and checking the Select the Display a notification about every script error check box. C. You should consider clearing the Disable Script Debugging (Internet Explorer) check box, and checking the Show friendly HTTP error messages check box. D. You should consider clearing the Disable Script Debugging (Other) check box, and checking the Display a notification about every script error check box. Select the Display a notification about every script error check box. Answer: B Explanation:

QUESTION NO: 18 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You have recently developed a Microsoft ASP.NET application with Microsoft .NET Framework version 3.5. You want to make sure that the timing and performance data of the application is gathered and only made available to users when they are logged on to ABC.coms Web server. Which of the following actions should you take? A. You should add a line of code to the Web.config file that sets the debug compilation Element to true, and the urlLinePragmas compilation Element to false. B. You should add a line of code to the Web.config file that sets the debug compilation Element to false, and the urlLinePragmas compilation Element to true. C. You should add a line of code to the Web.config file that sets the enabled trace Element to true, the pageOutput trace Element to false, and the localOnly trace Element to true. D. You should add a line of code to the Web.config file that sets the enabled trace Element to false, the pageOutput trace Element to true, and the localOnly trace Element to false. Answer: C Explanation:

QUESTION NO: 19

"Pass Any Exam. Any Time." - www.actualtests.com

14

Microsoft 70-562 Exam You work as a Web Developer at ABC.com. You create a Web application using Microsoft ASP.NET 3.5. ABC.com hosts the application in Microsoft Internet Information Services 7.0. You attempt to browse the application and receive the following error message: HTTP Error 503. The service is unavailable. What should you do to resolve this error as soon as possible? A. You should stop and restart IIS 7.0. B. You should change the pipeline mode associated with the application pool that hosts the application. C. You should run the ASP.NET Registration Tool (Aspnet_regiis.exe). D. You should make sure that the application pool that hosts the application is initiated. Answer: D Explanation:

QUESTION NO: 20 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 to create a Web application that allows users to upload files. The application is hosted in Microsoft Internet Information Services (IIS) 6.0 on a test server named ABC-SR01. The application uses the default application pool with Windows Authentication. When you attempt to upload a file from your workstation through the Web application you get an error message stating that access is denied. You enable debugging. You need to ensure that you can upload files via the Web application from your workstation. What should you do? (Choose all that apply) A. You should stop and restart the application pool on ABC-SR01. B. You should create a Debugger Users group on your workstation and add your Windows user account to it. C. You should add the following configuration to the Web.config file: <identity impersonate="true" /> D. You should add your Windows user account to the Administrators group on ABC-SR01. Answer: C Explanation:

"Pass Any Exam. Any Time." - www.actualtests.com

15

Microsoft 70-562 Exam QUESTION NO: 21 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. ABC.com has a Microsoft ASP.NET application that was developed using Microsoft .NET Framework version 3.5. While performing routine analysis of the applications performance counters, you notice that there is an unforeseen rise in application restarts. Which of the following options could cause this situation? A. Restarting a client workstation. B. Removing a workstation from the network. C. A new assembly is added to the applications Bin directory. D. The Web.config file is modified in the system.web section for debugging the application. Answer: C Explanation:

QUESTION NO: 22 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. ABC.com has a Microsoft ASP.NET application that must be reconfigured to include a new thene. You need to make use of Microsoft .NET Framework version 3.5 to complete this task. Subsequent to adding the theme, you are required to implement the theme in such a way that the theme settings take precedence over all individual control settings. Which of the following actions should you take?

"Pass Any Exam. Any Time." - www.actualtests.com

16

Microsoft 70-562 Exam A. You should consider setting the Theme attribute of the pages element to the name of the theme in the applications Web.config file. B. You should consider creating a default page for the application, and setting the Theme attribute to the name of the theme in the @Default directive. C. You should consider creating a master page for the application, and setting the Theme attribute to the name of the theme in the @Master directive. D. You should consider setting the Theme attribute of the pages element to the name of the theme in the applications App.config file. Answer: A Explanation:

QUESTION NO: 23 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of Microsoft .NET Framework 3.5 to develop a Microsoft ASP.NET application that has been configured to include numerous themes. Users are allowed to choose these themes to customize the Web page. Furthermore, the selected theme will be used everytime a user returns to the application even if its from another workstation. You need configure a suitable storage and retrieval solution, while keeping in mind that the application makes use of various types of storage in various locations. Which of the following actions should you take? A. You should consider configuring a SQL database named thesmes to store the user theme choices. B. You should considerconfiguring your solution to return the necessary theme name for the Session for every user visit to a page. C. You should consider storing the name of a users theme choice in the Response.Cookies collection. D. You should consider adding a setting for the theme to the machine.config file of the users workstation. Answer: B Explanation:

"Pass Any Exam. Any Time." - www.actualtests.com

17

Microsoft 70-562 Exam QUESTION NO: 24 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You have received instruction to develop an application that is configured to meet the requirements shown below: A different ASPX page must be displayed when the applications original URL is entered. Once the page executes, the Original URL should not be visible to users. A single client browser request should be sufficient for the execution of a page. Which of the following action should you take? A. You should consider making use of the the HttpContext.Current.GetType method. B. You should consider making use of the the HttpContext.Current.RemapHandler method. C. You should consider making use of the the HttpContext.Current.RewritePath method. D. You should consider making use of the the HttpContext.Current.ToString method. Answer: C Explanation:

QUESTION NO: 25 You work as a Web Developer at ABC.com. You create a Web application using Microsoft ASP.NET 3.5. The Web application is hosted on a Web farm. The Web farm consists of three Web servers. You should configure the Web application for session state in order to meet the following requirements: The session state data should not be lost if a server fails. The session state should be maintained across browser requests by the same user. You need to configure the Web.config file to meet these requirements. How would you accomplish this goal? A. You should use the <sessionState mode="SQLServer"/> configuration. B. You should use the <sessionState mode="StateServer"/> configuration. C. You should use the <sessionState mode="Custom"/> configuration.

"Pass Any Exam. Any Time." - www.actualtests.com

18

Microsoft 70-562 Exam D. You should use the <sessionState mode="InProc"/> configuration. Answer: A

QUESTION NO: 26 You work as a C# Web Developer at ABC.com. You are creating a Web application using Microsoft ASP.NET 3.5. The compilation debug made is set to false. You want to use VisualBasic.NET code in the web application. You don't want to convert the code to C#. You create a new folder for the VB.NET code in the App_Code folder and add a reference to it in the compilation section of the Web.config file. You must ensure that the code can be compiled at run time. How would you alter the application? A. You should add an assembly reference to the project. B. You should add a project reference to the project. C. You should add a Web reference to the project. D. Do nothing. Answer: D

QUESTION NO: 27 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. In a separate code file you create a public static class named ABCColors. You want the ABCColors class to be consumed by the Web application and you want the Web application to be automatically recompiled when the ABCColors class is modified. How should you configure the Web application? A. You should add the file to the App_Code folder of the project. B. You should add a Register directive that will reference the file to every page that makes use of the class. C. This can be accomplished by referencing the file in the assemblies segment of the Web.config file. "Pass Any Exam. Any Time." - www.actualtests.com 19

Microsoft 70-562 Exam D. This can be accomplished by referencing the file in the httpHandlers segment of the Web.config file. Answer: A

QUESTION NO: 28 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed a Web application that includes a Web page named ABC.aspx. ABC.aspx has been configured to include various controls. After creating a new custom control and adding it to ABC.aspx, you are informed that the state of the custom control should stay static for 2 minutes. You have also been informed that the cache settings of other elements in the ABC.aspx Web page should be unaffected by the settings of the custom control. You have created the code shown below (Line numbers are shown purely for reference.): 1.<caching> 2.<outputCacheSettings> 3.<outputCacheProfiles> 4. 5. 6. 7. 8.</outputCacheProfiles> 9.</outputCacheSettings> 10.</caching> Which of the following should be inserted into the vacant lines prior to adding it to the Web.config file? A. <add name="CachedProfileSet" "Pass Any Exam. Any Time." - www.actualtests.com 20

Microsoft 70-562 Exam varyByControl="controlname" duration="120" /> B. <add name="CachedProfileSet" varyByParam="CachedControl" duration="2" /> C. <ProfileCache profile="CachedProfileSet" varyByControl="CachedControl" duration="120"> </ProfileCache> D. <ProfileCache profile="CachedProfileSet" varyByControl="CachedControl" duration="2"> </ProfileCache> Answer: A Explanation:

QUESTION NO: 29 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. Your Web application contains a Web form that displays data from a SQL Server 2005 database in a repeater as shown below: <asp:Repeater ID="ABCRepeater" runat="server" DataSourceID="SqlDS1" ItemDataBound="_ItemBound"> <ItemTemplate> <asp:Hyperlink ID="hlName" runat="server" Text='<%# Eval("ProdName") %> NavigateURL='<%# Eval("ProdURL") %>' /> </ItemTemplate>

"Pass Any Exam. Any Time." - www.actualtests.com

21

Microsoft 70-562 Exam </asp:Repeater> You add code to handle the _ItemBound event handler. The code requires you to access the value of the hlName HyperLink into a variable named var. What code segment should you include in the _ItemBound event handler to accomplish this task? A. You should add the code: HyperLink var = Page.FindControl("hlName") as HyperLink; B. You should add the code: HyperLink var = e.Item.FindControl("hlName") as HyperLink; C. You should add the code: HyperLink var = rptData.FindControl("hlName") as HyperLink; D. You should add the code: HyperLink var = e.Item.Parent.FindControl("hlName ") as HyperLink; Answer: B Explanation: QUESTION 4 You work as a Web Developer at ABC.com. You create a Web application using Microsoft ASP.NET 3.5. After creating a new application, you create two user controls named ABCUserCtrl.ascx and TestUserCtrl.ascx, which is configured to postback to the server. You then create a new Web page that has AutoPostBack set to true for the oncheckedchanged method. You then write code to dynamically create the user controls in the Web page. You also include the following method in the Web page: protected override void LoadViewState(object savedState) { base.LoadViewState(savedState); LoadControls Which of the following options are TRUE with regards to this configuration? (Choose two.) A.It allows for the displayed user control to be recreated during postback. B.It prevents the displayed user control from being recreated during postback. C.It allows the displayed user control to maintain its state. D.It allows the displayed user control to discard its state.

"Pass Any Exam. Any Time." - www.actualtests.com

22

Microsoft 70-562 Exam

Answer: A, C

QUESTION NO: 30 You work as a Web Developer at ABC.com. You create a Web application using Microsoft ASP.NET 3.5. The Web application contains the following class: public class Certs { public string Title {get; set;} public string Number { get; set; } public string Vendor { get; set; } } You store data in an XML file that uses the following structure: <Certs> <title>cert title</title> <code>xx-xxx</code> <vendor>vendor name</vendor> </Certs>

"Pass Any Exam. Any Time." - www.actualtests.com

23

Microsoft 70-562 Exam You create an instance of List<Certs> named ABCCertsList. You create an XML String Reader named ABCStrRead to access the data in the XML data file named certData. You have to make sure that data in the XML file is bound to the ABCCertList instance and that every Exam instance will display the Title property. You decide to write code in order to bind the certData control to the ABCCertsList instance. Identify the code segment that should be used? A. You should use the code segment: certData.DataSource = ABCCertList; certData.DataValueField = "Certs.title"; certData.DataBind(); B. You should use the code segment: certData.DataSource = ABCCertList; certData.DataTextField = "title"; certData.DataBind(); C. You should use the code segment: XmlSerializer xmlserial = new XmlSerializer(typeof(Certs)); Certs cert = xmlserial.Deserialize(xmlStream) as Certs; ABCCertList.Text = cert.title(); D. You should use the code segment: XmlReader xmlread = XmlReader.Create(xmlStream); Certs cert = xmlread.ReadContentAs(typeof(Certs),null) as Certs; ABCCertList.Text = cert.title(); Answer: C Explanation:

QUESTION NO: 31 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have recently developed a Web application that includes a Web page named ErrorPage.aspx. For the purpose of managing unhandled application exceptions, you want to make sure that the ErrorPage.aspx page is shown and that the exception data is written to the Event log. You have added the code shown below to the web.config file: "Pass Any Exam. Any Time." - www.actualtests.com 24

Microsoft 70-562 Exam <customErrors mode="On" defaultRedirect="ErrorPage.aspx" /> Which of the following actions should you take NEXT? A. You should consider inserting the code shown below into the master page. void Application_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); //Write Exception details to event log } B. You should consider inserting the code shown below into the Default.asax file. void Application_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); //Write Exception details to event log } C. You should consider inserting the code shown below into the Global.asax file. void Application_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); //Write Exception details to event log } D. Add the following code segment to the ErrorPage.aspx file. void Page_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); //Write Exception details to event log Server.ClearError(); } Answer: C Explanation:

QUESTION NO: 32 You work as an ASP.NET 3.5 Developer at ABC.com. You are in the process of creating a Web application that is accessed at http://www.ABC.com/ABCApp. The application needs to display an error page that contains the stack trace automatically when an unhandled exception occurs on the products.aspx. This error page must only be displayed to remote users. You set the Page attribute for the products.aspx page to:

"Pass Any Exam. Any Time." - www.actualtests.com

25

Microsoft 70-562 Exam <%@ Page Language="VB" AutoEventWireup="true" CodeFile="products.aspx.vb" Inherits="_products" ErrorPage="~/ABCApp/error.html" Debug="false" %> You now need to configure the Web.config file to accomplish this accordingly. Which configuration should you use? A. <customErrors mode="Off"> <error statusCode="500" redirect="error.html" /> </customErrors> B. <customErrors mode="On" /> C. <customErrors mode="Remote Only" /> D. <compilation debug="true"/> Answer: B Explanation:

QUESTION NO: 33 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed an application that has a master page configured with a staic navigation menu for site browsing. All content pages in the application are configured to make use of this master page. You have been instructed to make sure that the content pages have the option to substitute the static navigation menu with menu controls of their own. You have written the code shown below: PlaceHolder placeHolder = Page.Master.FindControl("MenuPlaceHolder") as PlaceHolder; "Pass Any Exam. Any Time." - www.actualtests.com 26

Microsoft 70-562 Exam Menu menuControl = new Menu(); placeHolder.Controls.Add(menuControl); Which of the following action should you take NEXT? A. You should consider adding the code segment to the default page. B. You should consider adding the code segment to the Page_Load event of the content page. C. You should consider adding the code segment directly to the content page. D. You should consider adding the code segment to the master page. Answer: B Explanation:

QUESTION NO: 34 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of ok Microsoft .NET Framework version 3.5 to develop a Microsoft ASP.NET application. After creating a default Web page, named Default.aspx, you create ImageResources.resx resource file that includes a localized resource named LogoImageUrl. You are required to make sure that the LogoImageUrl localized resource is shared between the applications pages. Which of the following actions should you take? A. You should consider adding the ImageResources.resx resource file to the App_GlobalResources folder. B. You should consider adding the ImageResources.resx resource file to the App_LocalResources folder. C. You should consider adding the ImageResources.resx resource file to the App_WebReferences folder. D. You should consider adding the ImageResources.resx resource file to the App_Data folder. Answer: A Explanation:

"Pass Any Exam. Any Time." - www.actualtests.com

27

Microsoft 70-562 Exam

QUESTION NO: 35 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have created a new application, and configured it to be hosted by a Microsoft Internet Information Services (IIS) 6.0 server. The application includes a page named OldTestPage.aspx. You have been informed that when attempt to access the OldTestPage.aspx is made, the browser should show the URL for the page and present a page named NewTestPage.aspx. Which of the following actions should you take? A. You should make use of the code shown below: Server.Transfer("NewTestPage.aspx"); B. You should make use of the code shown below: Response.Redirect("NewTestPage.aspx"); C. You should make use of the code shown below: Server.Execute("NewTestPage.aspx"); D. You should make use of the code shown below: Server.MapPath("NewTestPage.aspx"); Answer: A Explanation:

QUESTION NO: 36 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. Subsequent to developing a Microsoft ASP.NET application using Microsoft .NET Framework version 3.5, you create a Web page named enterDetails.aspx that includes a TextBox control named txtDetails. The enterDetails.aspx Web page is configured to cross-post to another page, named displayDetails.aspx, which is configured with a Label control named lblDetails. You have been informed that any text entered in the the txtDetails TextBox control should be displayed by the lblDetails Label control. "Pass Any Exam. Any Time." - www.actualtests.com 28

Microsoft 70-562 Exam Which of the following actions should you take? A. You should make use of the code shown below: TextBox txtDetails = NextPage.FindControl("txtDetails") as TextBox; lblName.Text = txtDetails.Text; B. You should make use of the code shown below: TextBox txtDetails = FindControl("txtDetails") as lblDetails; lblName.Text = lblDetails.Text; C. You should make use of the code shown below: TextBox txtDetails = PreviousPage.FindControl("txtDetails") as lblDetails; lblName.Text = lblDetails.Text; D. You should make use of the code shown below: TextBox txtDetails = PreviousPage.FindControl("txtDetails") as TextBox; lblName.Text = txtDetails.Text; Answer: D Explanation:

QUESTION NO: 37 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. The application contains an IHttpHandler interface named ABCHandler. You want to render the validationBitmap instance as a JPEG image as soon as ABCHandler is requested. What code segment should you add to the ABCHandles IHttpHandler interface? A. You should add thefollowing code segment: public void ProcessRequest(HttpContext context) { Bitmap validationBitmap = (Bitmap)Session["ValidationImage"]; context.Response.ContentType = "image/jpeg"; context.Response.Write(validationBitmap); } B. You should add thefollowing code segment: public void ProcessRequest(HttpContext context) { Bitmap validationBitmap = (Bitmap)Session["ValidationImage"]; context.Response.ContentType = "image/jpeg"; validationBitmap.Save(context.Request.InputStream, ImageFormat.Jpeg); } C. You should add thefollowing code segment: public void ProcessRequest(HttpContext context) "Pass Any Exam. Any Time." - www.actualtests.com 29

Microsoft 70-562 Exam { Bitmap validationBitmap = (Bitmap)Session["ValidationImage"]; context.Response.ContentType = "image/jpeg"; context.Response.Write(validationBitmap.RawFormat); } D. You should add thefollowing code segment: public void ProcessRequest(HttpContext context) { Bitmap validationBitmap = (Bitmap)Session["ValidationImage"]; context.Response.ContentType = "image/jpeg"; validationBitmap.Save(context.Response.OutputStream, ImageFormat.Jpeg); } Answer: D

QUESTION NO: 38 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of Microsoft .NET Framework 3.5 to develop a Microsoft ASP.NET application. You then create a class to implement the IHttpHandler interface. You have received instruction to write code to make sure that whenever the handler is requested, the Warning.jpg image is displayed in the browser. Which of the following represents the code that you should write? A. public void ProcessRequest(HttpContext ctx) { StreamReader sr = new StreamReader(_File.OpenRead(ctx.Server.MapPath("Warning.jpg"))); ctx.Response(sr.ReadToEnd()); } B. public void ProcessRequest(HttpContext ctx) { StreamReader sr = new StreamReader(OpenRead(ctx.Server.MapPath("Warning.jpg"))); ctx.Response.Pics("pic "); sr.Close(); } C. public void ProcessRequest(HttpContext ctx) {ctx.Response.ContentType = "image/jpg"; FileStream fs = File.OpenRead(_ctx.Server.MapPath("Warning.jpg")); int b = 0; while ((b == fs.ReadByte()) != -1) {ctx.Response.OutputStream.WriteByte(Convert.ToByte(b)); "Pass Any Exam. Any Time." - www.actualtests.com 30

Microsoft 70-562 Exam } fs.Close(); } D. public void ProcessRequest(HttpContext ctx) { ctx.Response.TransmitFile("image/jpg"); (_ctx.Server.MapPath("Warning.jpg")); Stream b = default(Stream); while ((b == fs.ReadByte()) != -1) { ctx.Response.Output.Write((b)); } Fs.Close(); } Answer: C Explanation:

QUESTION NO: 39 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of ok Microsoft .NET Framework version 3.5 to develop a Microsoft ASP.NET application. The application should be configured to facilitate the posting of user comments, which must remain visible to all application users. You are required to write suitable code that makes use of the SqlDataSource control named SqlDataSource1 and allows for the IP address of every user that posts a comment to be captured. You start writing the code as follows: private void SaveComment() { string ipaddr = null; ipaddr = Request.ServerVariables("REMOTE_ADDR").ToString();

Which of the following lines of code should you write NEXT? A. SqlDataSource1.InsertParameters("IPAddress") = ipaddr;

"Pass Any Exam. Any Time." - www.actualtests.com

31

Microsoft 70-562 Exam B. SqlDataSource1.Insert() C. // ... D. SqlDataSource1.InsertParameters("IPAddress").DefaultValue = ipaddr; Answer: D Explanation:

QUESTION NO: 40 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have created an application that includes a mobile Web form configured with an ObjectList control. The ObjectList control is configured to make use of the OnItemCommand method to return results for the CmdDisplayDetails and CmdRemove item commands. You have also created an event handler named ObjectListCtrl_ItemCommand, and written the code shown below: public void ObjectListCtrl_ItemCommand(object sender, ObjectListCommandEventArgs e) { if (e.CommandName == "CmdDisplayDetails") { } } Which of the following is TRUE with regards to the code? A. It allows for the event handler to detect the selection of the CmdDisplayDetails item. B. It allows for the event handler to delete the selection of the CmdDisplayDetails item. C. It allows for the event handler to the select the CmdDisplayDetails item. D. It prevents the event handler from detecting the selection of the CmdDisplayDetails item. Answer: A Explanation:

"Pass Any Exam. Any Time." - www.actualtests.com

32

Microsoft 70-562 Exam

QUESTION NO: 41 You work as an ASP.NET 3.5 Developer at ABC.com. You are in the process of creating a Web application that is accessed at http://www.ABC.com/ABCApp. The application needs to display an error page that contains the stack trace automatically when an unhandled exception occurs on the products.aspx. This error page must only be displayed to remote users. You set the Page attribute for the products.aspx page to: <%@ Page Language="VB" AutoEventWireup="true" CodeFile="products.aspx.vb" Inherits="_products" ErrorPage="~/ABCApp/error.html" Debug="false" %>

"Pass Any Exam. Any Time." - www.actualtests.com

33

Microsoft 70-562 Exam You now need to configure the Web.config file to accomplish this accordingly. Which configuration should you use? A. <customErrors mode="Off"> <error statusCode="500" redirect="error.html" /> </customErrors> B. <customErrors mode=" Page.Master.FindControl On" /> C. <customErrors mode="Remote Only" /> D. <compilation debug="true"/> Answer: B Explanation:

QUESTION NO: 42 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have created an application that includes a mobile Web form configured with an ObjectList control. The ObjectList control is configured to make use of the OnItemCommand method to return results for the CmdDisplayDetails and CmdRemove item commands. You have also created an event handler named ObjectListCtrl_ItemCommand, and written the code shown below: Public Sub ObjectListCtrl_ItemCommand( _ ByVal sender As Object, ByVal e As ObjectListCommandEventArgs) If e.CommandName = "CmdDisplayDetails" Then End If End Sub Which of the following is TRUE with regards to the code?

"Pass Any Exam. Any Time." - www.actualtests.com

34

Microsoft 70-562 Exam A. It allows for the event handler to detect the selection of the CmdDisplayDetails item. B. It allows for the event handler to delete the selection of the CmdDisplayDetails item. C. It allows for the event handler to the select the CmdDisplayDetails item. D. It prevents the event handler from detecting the selection of the CmdDisplayDetails item. Answer: A Explanation:

QUESTION NO: 43 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have developed an application that has a master page configured with a staic navigation menu for site browsing. All content pages in the application are configured to make use of this master page. You have been instructed to make sure that the content pages have the option to substitute the static navigation menu with menu controls of their own. You have written the code shown below: Dim placeHolder As PlaceHolder = TryCast( _ Page.Master.FindControl("MenuPlaceHolder"), PlaceHolder) Dim menuControl As New Menu() placeHolder.Controls.Add(menuControl) Which of the following action should you take NEXT? A. You should consider adding the code segment to the default page. B. You should consider adding the code segment to the Page_Load event of the content page. C. You should consider adding the code segment directly to the content page. D. You should consider adding the code segment to the master page. Answer: B Explanation:

QUESTION NO: 44 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain "Pass Any Exam. Any Time." - www.actualtests.com 35

Microsoft 70-562 Exam named ABC.com. You make use of ok Microsoft .NET Framework version 3.5 to develop a Microsoft ASP.NET application. The application should be configured to facilitate the posting of user comments, which must remain visible to all application users. You are required to write suitable code that makes use of the SqlDataSource control named SqlDataSource1 and allows for the IP address of every user that posts a comment to be captured. You start writing the code as follows: Private Sub SaveComment() Dim ipaddr As String ipaddr = Request.ServerVariables("REMOTE_ADDR").ToString()

Which of the following lines of code should you write NEXT? A. SqlDataSource1.InsertParameters("IPAddress") = ipaddr B. SqlDataSource1.Insert() C. End Sub D. SqlDataSource1.InsertParameters("IPAddress").DefaultValue = ipaddr Answer: D

QUESTION NO: 45 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of ok Microsoft .NET Framework version 3.5 to develop a Microsoft ASP.NET application. After creating a default Web page, named Default.aspx, you create ImageResources.resx resource file that includes a localized resource named LogoImageUrl. You are required to make sure that the LogoImageUrl localized resource is shared between the applications pages. Which of the following actions should you take?

"Pass Any Exam. Any Time." - www.actualtests.com

36

Microsoft 70-562 Exam A. You should consider adding the ImageResources.resx resource file to the App_GlobalResources folder. B. You should consider adding the ImageResources.resx resource file to the App_LocalResources folder. C. You should consider adding the ImageResources.resx resource file to the App_WebReferences folder. D. You should consider adding the ImageResources.resx resource file to the App_Data folder. Answer: A Explanation:

QUESTION NO: 46 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. Subsequent to developing a Microsoft ASP.NET application using Microsoft .NET Framework version 3.5, you create a Web page named enterDetails.aspx that includes a TextBox control named txtDetails. The enterDetails.aspx Web page is configured to cross-post to another page, named displayDetails.aspx, which is configured with a Label control named lblDetails. You have been informed that any text entered in the the txtDetails TextBox control should be displayed by the lblDetails Label control. Which of the following actions should you take? A. You should make use of the code shown below: Dim txtDetails As TextBox = TryCast(NextPage.FindControl("txtDetails"), TextBox) lblName.Text = txtDetails.Text B. You should make use of the code shown below: Dim txtDetails As TextBox = TryCast(FindControl("txtDetails"), lblDetails) lblName.Text = lblDetails.Text C. You should make use of the code shown below: Dim txtDetails As TextBox = TryCast(PreviousPage.FindControl("txtDetails"), lblDetails) lblName.Text = lblDetails.Text

"Pass Any Exam. Any Time." - www.actualtests.com

37

Microsoft 70-562 Exam D. You should make use of the code shown below: Dim txtDetails As TextBox = TryCast(PreviousPage.FindControl("txtDetails"), TextBox) lblName.Text = txtDetails.Text Answer: D Explanation:

QUESTION NO: 47 You work as a Web Developer at ABC.com. The ABC.com network consists of a single domain named ABC.com. You make use of Microsoft .NET Framework 3.5 to develop a Microsoft ASP.NET application. You then create a class to implement the IHttpHandler interface. You have received instruction to write code to make sure that whenever the handler is requested, the Warning.jpg image is displayed in the browser. Which of the following represents the code that you should write? A. Public Sub ProcessRequest(ByVal ctx As HttpContext) Dim sr As New StreamReader( _File.OpenRead(ctx.Server.MapPath("Warning.jpg"))) ctx.Response(sr.ReadToEnd()) End Sub B. Public Sub ProcessRequest(ByVal ctx As HttpContext) Dim sr As New StreamReader(OpenRead(ctx.Server.MapPath("Warning.jpg"))) ctx.Response.Pics("pic ") sr.Close() End Sub C. Public Sub ProcessRequest(ByVal ctx As HttpContext) ctx.Response.ContentType = "image/jpg" Dim fs As FileStream = File.OpenRead( _ctx.Server.MapPath("Warning.jpg")) Dim b As Integer While (b = fs.ReadByte()) <> -1 ctx.Response.OutputStream.WriteByte(CByte(b)) End While Fs.Close() End Sub D. Public Sub ProcessRequest(ByVal ctx As HttpContext) ctx.Response.TransmitFile("image/jpg") ( _ctx.Server.MapPath("Warning.jpg")) Dim b As Stream While (b = fs.ReadByte()) <> -1

"Pass Any Exam. Any Time." - www.actualtests.com

38

Microsoft 70-562 Exam ctx.Response.Output.Write((b)) End While Fs.Close() End Sub Answer: C Explanation:

QUESTION NO: 48 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. Your Web application contains a Web form that displays data from a SQL Server 2005 database in a repeater as shown below: <asp:Repeater ID="ABCRepeater" runat="server" DataSourceID="SqlDS1" ItemDataBound="_ItemBound"> <ItemTemplate> <asp:Hyperlink ID="hlName" runat="server" Text='<%# Eval("ProdName") %> NavigateURL='<%# Eval("ProdURL") %>' /> </ItemTemplate> </asp:Repeater> You add code to handle the _ItemBound event handler. The code requires you to access the value of the hlName HyperLink into a variable named var. What code segment should you include in the _ItemBound event handler to accomplish this task? A. You should add the code: Dim var As HyperLink = TryCast(Page.FindControl("hlName"), HyperLink) B. You should add the code: HyperLink var = Dim var As HyperLink = TryCast(e.Item.FindControl("hlName"), HyperLink) C. You should add the code: Dim var As HyperLink = TryCast(rptData.FindControl("hlName"), HyperLink) D. You should add the code: Dim var As HyperLink = TryCast(e.Item.Parent.FindControl("hlName "), HyperLink)

"Pass Any Exam. Any Time." - www.actualtests.com

39

Microsoft 70-562 Exam Answer: B Explanation:

QUESTION NO: 49 You work as a Web Developer at ABC.com. You create a Web application using Microsoft ASP.NET 3.5. The Web application contains the following class: Public Class Certs Public Property Title() As String Get Return m_Title End Get Set m_Title = Value End Set End Property Private m_Title As String Public Property Number() As String Get Return m_Number End Get Set m_Number = Value End Set End Property Private m_Number As String Public Property Vendor() As String "Pass Any Exam. Any Time." - www.actualtests.com 40

Microsoft 70-562 Exam Get Return m_Vendor End Get Set m_Vendor = Value End Set End Property Private m_Vendor As String End Class You store data in an XML file that uses the following structure: <Certs> <title>cert title</title> <code>xx-xxx</code> <vendor>vendor name</vendor> </Certs> You create an instance of List<Certs> named ABCCertsList. You create an XML String Reader named ABCStrRead to access the data in the XML data file named certData. You have to make sure that data in the XML file is bound to the ABCCertList instance and that every Exam instance will display the Title property. You decide to write code in order to bind the certData control to the ABCCertsList instance. Identify the code segment that should be used? A. You should use the code segment: certData.DataSource = ABCCertList certData.DataValueField = "Certs.title" certData.DataBind() B. You should use the code segment: certData.DataSource = ABCCertList certData.DataTextField = "title" certData.DataBind() C. You should use the code segment: Dim xmlserial As New XmlSerializer(GetType(Certs)) Dim cert As Certs = TryCast(xmlserial.Deserialize(xmlStream), Certs) ABCCertList.Text = cert.title() "Pass Any Exam. Any Time." - www.actualtests.com 41

Microsoft 70-562 Exam D. You should use the code segment: Dim xmlread As XmlReader = XmlReader.Create(xmlStream) Dim cert As Certs = TryCast(xmlread.ReadContentAs(GetType(Certs), Nothing), Certs) ABCCertList.Text = cert.title() Answer: C Explanation:

QUESTION NO: 50 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have recently developed a Web application that includes a Web page named ErrorPage.aspx. For the purpose of managing unhandled application exceptions, you want to make sure that the ErrorPage.aspx page is shown and that the exception data is written to the Event log. You have added the code shown below to the web.config file: <customErrors mode="On" defaultRedirect="ErrorPage.aspx" /> Which of the following actions should you take NEXT? A. You should consider inserting the code shown below into the master page. Private Sub Application_Error(sender As Object, e As EventArgs) Dim exc As Exception = Server.GetLastError() 'Write Exception details to event log End Sub B. You should consider inserting the code shown below into the Default.asax file. Private Sub Application_Error(sender As Object, e As EventArgs) Dim exc As Exception = Server.GetLastError() 'Write Exception details to event log End Sub C. You should consider inserting the code shown below into the Global.asax file. Private Sub Application_Error(sender As Object, e As EventArgs) Dim exc As Exception = Server.GetLastError() 'Write Exception details to event log End Sub D. Add the following code segment to the ErrorPage.aspx file. Private Sub Application_Error(sender As Object, e As EventArgs) Dim exc As Exception = Server.GetLastError() 'Write Exception details to event log End Sub "Pass Any Exam. Any Time." - www.actualtests.com 42

Microsoft 70-562 Exam Answer: C

QUESTION NO: 51 You work as a Web Developer at ABC.com. You make use of Microsoft .NET Framework 3.5 to develop ASP.NET Web applications. You have created a new application, and configured it to be hosted by a Microsoft Internet Information Services (IIS) 6.0 server. The application includes a page named OldTestPage.aspx. You have been informed that when attempt to access the OldTestPage.aspx is made, the browser should show the URL for the page and present a page named NewTestPage.aspx. Which of the following actions should you take? A. You should make use of the code shown below: Server.Transfer("NewTestPage.aspx"); B. You should make use of the code shown below: Response.Redirect("NewTestPage.aspx"); C. You should make use of the code shown below: Server.Execute("NewTestPage.aspx"); D. You should make use of the code shown below: Server.MapPath("NewTestPage.aspx"); Answer: A Explanation:

QUESTION NO: 52 You work as a Web Developer at ABC.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. The application contains an IHttpHandler interface named ABCHandler. You want to render the validationBitmap instance as a JPEG image as soon as ABCHandler is requested. What code segment should you add to the ABCHandles IHttpHandler interface? A. You should add thefollowing code segment: Public Sub ProcessRequest(context As HttpContext) Dim validationBitmap As Bitmap = DirectCast(Session("ValidationImage"), Bitmap) context.Response.ContentType = "image/jpeg" context.Response.Write(validationBitmap) "Pass Any Exam. Any Time." - www.actualtests.com 43

Microsoft 70-562 Exam End Sub B. You should add thefollowing code segment: Public Sub ProcessRequest(context As HttpContext) Dim validationBitmap As Bitmap = DirectCast(Session("ValidationImage"), Bitmap) context.Response.ContentType = "image/jpeg" validationBitmap.Save(context.Request.InputStream, ImageFormat.Jpeg) End Sub C. You should add thefollowing code segment: Public Sub ProcessRequest(context As HttpContext) Dim validationBitmap As Bitmap = DirectCast(Session("ValidationImage"), Bitmap) context.Response.ContentType = "image/jpeg" context.Response.Write(validationBitmap.RawFormat) End Sub D. You should add thefollowing code segment: Public Sub ProcessRequest(context As HttpContext) Dim validationBitmap As Bitmap = DirectCast(Session("ValidationImage"), Bitmap) context.Response.ContentType = "image/jpeg" validationBitmap.Save(context.Response.OutputStream, ImageFormat.Jpeg) End Sub Answer: D

"Pass Any Exam. Any Time." - www.actualtests.com

44

You might also like