Microsoft 70-315 Real Exam Questions
Developing and Implementing Web Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET
1: You are a member of a team of developers creating several ASP.NET applications for your company. You want to create a reusable toolbar that will be used in each of the applications. The toolbar will be displayed at the top of each page viewed by the user. The contents of the toolbar will vary depending on options each user selects when creating a profile. You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team. What should you do?
A.Create a new Web Control Library project.
Create the toolbar within a Web custom control.
B.Add a new Web user control to your ASP.NET project.
Create the toolbar within the Web user control.
C.Add a new Web Form to your ASP.NET project.
Design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D.Add a new component class to your ASP.NET project.
Design the toolbar within the designer of the component class.
Correct Answers: A
2: You create a class named MyFormat that has two public properties. One of the properties is named Size, and the other property is named Color. You want to use the MyFormat class in custom server controls to expose format properties to container pages.
You add the following statements to a custom server control named MessageRepeater:
private MyFormat _formatter = new MyFormat();
public MyFormat Format
{
get { return _formatter; }
}
You create a container page named MessageContainer.aspx to test your custom control. You register the control as follows:
<%@ Register Tagprefix="myctl" Namespace="MessageControls"
Assembly="MessageControls" %>
You want to add an instance of the control to a test page so that the size property is set to 10 and the color property is set to red. Which code should you use?
Correct Answers:
3: You are creating an ASP.NET application that will be published in several languages. You develop a satellite assembly that will include the localized resources for one of the other languages. The satellite assembly will also contain code that accesses Enterprise Services. Your company has a build team that is responsible for compiling and publishing all software applications created by your group. The build team is also responsible for digitally signing the software with a public/private key pair. The build team permits you to have access to your company’s public key, but not the private key. In order to test your localized satellite assembly, you need to digitally sign the assembly. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.Create a test certificate for your satellite assembly by using the Software Publisher Certificate Test tool (Cert2spc.exe).
B.Compile the satellite assembly by using the Resource File Generator (Resgen.exe) with the /compile switch.
C.Compile the satellite assembly by using the Assembly Linker (Al.exe) with the /delay+ switch.
D.Use the Global Assembly Cache tool (Gacutil.exe) to install the assembly in the global assembly cache.
E.Generate a new public/private key pair by using the Strong Name tool (Sn.exe).
Use the new key pair to sign the assembly temporarily for testing purposes.
Correct Answers: C E
4: You create a user control named Address that is defined in a file named Address.ascx. Address displays address fields in an HTML table. Some container pages might contain more than one instance of the Address user control. For example, a page might contain a shipping address and a billing address. You add a public property named Caption to the Address user control. The caption property will be used to distinguish the different instances. You want the caption to be displayed in the first <td> element of the table of address fields. You need to add code to the <td> element of the table to display the caption. Which code should you use?
A.<td><%=Caption%></td>
B.<td><script runat="server">Caption</script></td>
C.<td><script>document.write("Caption");</script></td>
D.<td>=Caption</td>
Correct Answers: A
5: You create an ASP.NET application named MyApp. You create an assembly named MyApp.dll in a directory named MyDir. The assembly includes a default resource file named strings.resources that adequately supports English-speaking users of the application. You create an additional resource file named strings.ja.resources to enable support for Japanese-speaking users. The resource file is located in the MyDir/ja subdirectory. You want to create a satellite assembly for MyApp.dll that will use the new resource file. What should you do?
A.Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.
Place the output assembly in MyDir.
B.Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.
Place the output assembly in MyDir/ja.
C.Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.
Place the output assembly in MyDir.
D.Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.
Place the output assembly in MyDir/ja.
Correct Answers: B
6: You create an ASP.NET application named Inventory. This application will be used by customers on the Internet. During the beta test period, you ensure that the actual ASP.NET error message is displayed whenever an error is encountered. Both developers and beta testers see the actual text of the error message. You perform beta testing of other applications on the same beta test server during the beta testing period for Inventory. All of the other applications display ASP.NET error messages. After the beta testing period is complete, the beta test server is promoted to a production server. You want all applications to display a single, user-friendly error message. You want to configure Inventory and the production server to meet these goals. You want to perform this task by using the minimum amount of administrative effort. Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)
A.Set the mode parameter of the customErrors element in the Web.config file for Inventory to "On".
B.Remove the customErrors element from the Web.config file for Inventory.
C.Set the mode parameter of the customErrors element in the Inventory.config file to "On".
D.Remove the customErrors element from the Inventory.config file.
E.Set the mode parameter of the customErrors element in the Machine.config file to "On".
F.Remove the customErrors element from the Machine.config file.
Correct Answers: B E
7: You create an ASP.NET application for Contoso, Ltd. The company uses Microsoft Windows authentication. All users are in the contoso domain. You want to configure the application to use the following authorization rules:
.Anonymous users must not be allowed to access the application.
.All employees except Marie and Pierre must be allowed to access the application.
Which code segment should you use to configure the application?
A.<authorization>
<deny users="contoso\marie, contoso\pierre">
<allow users="*">
<deny users="?">
</authorization>
B.<authorization>
<allow users="*">
<deny users="contoso\marie, contoso\pierre">
<deny users="?">
</authorization>
C.<authorization>
<deny users="contoso\marie, contoso\pierre">
<deny users="?">
<allow users="*">
</authorization>
D.<authorization>
<deny users="contoso\marie, contoso\pierre">
<allow users="*">
</authorization>
E.<authorization>
<allow users="*">
<deny users="contoso\marie, contoso\pierre">
</authorization>
Correct Answers: C
8: Your ASP.NET application displays sales data on a page. You want to improve performance by holding the page in memory on the server for one hour. You want to ensure that the page is flushed from memory after one hour, and that the page is re-created when the next request for the page is received. What should you do?
A.Initialize a new instance of the Cache class in the Application.Start event handler.
B.Initialize a new instance of the Timer class in the Page.Load event handler.
C.Set the Duration attribute of the OutputCache directive in the page.
D.In the Web.config file, set the timeout attribute of the sessionState element.
Correct Answers: C
9: You create an ASP.NET application named TimeSheet for your company’s intranet. The application will be used only by
employees of your company.
You want the application to recognize the user without forcing the user to enter a name and password. You write the following
code to save the user’s Microsoft Windows login name in the Session object:
Session.Item["User"]=User.Identity.Name;
When you run TimeSheet, the Session.Item["User"] variable returns an empty string.
You want to configure Internet Information Services (IIS) and your application to be able to retrieve the user name automatically. What should you
do?
A.Disable Anonymous Access for the application in IIS.
B.Enable Basic authentication for the application in IIS.
C.Add the following element to the Web.config file for TimeSheet:
<identity impersonate="True" />
D.Add the following element to the Web.config file for TimeSheet:
<identity impersonate="False" />
Correct Answers: A
10: You are creating an ASP.NET application for an insurance company. Customers will use the application to file claim forms online. You plan to deploy the application over multiple servers. You want to save session state information to optimize performance. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.Modify the Web.config file to support StateServer mode.
B.Modify the Web.config file to support SQLServer mode.
C.Modify the Web.config file to support InProc mode.
D.In the Session_Start procedure in the Global.asax file, set the EnableSession property of the WebMethod attribute to true.
E.In the Session_Start procedure in the Global.asax file, set the Description property of the WebMethod attribute to sessionState.
Correct Answers: A B
Download | Password: certificatexam.com
Absorbing text. Gratefull and looking forward to another one.