Which code segment should you insert at line 06?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.
You create a login Web form by using the following code fragment.
<asp:ScriptManager ID=”ScriptManager1″ runat=”server” />
<asp:TextBox runat=”server” ID=”txtUser” Width=”200px” />
<asp:TextBox runat=”server” ID=”txtPassword” Width=”200px” />
<asp:Button runat=”server” ID=”btnLogin” Text=”Login” OnClientClick=”login(); return false;” />
When a user clicks the btnLogin Button control, the login() client-side script is called
to authenticate the user. The credentials provided in the TextBox controls are used to
call the client-side script.
You also add the following client-script code fragment in the Web form. (Line numbers
are included for reference only.)
01 <script type=”text/javascript”>
02 function login() {
03 var username = $get(‘txtUser’).value;
04 var password = $get(‘txtPassword’).value;
05
06 // authentication logic.
07 }
08 function onLoginCompleted(validCredentials, userContext,
09 methodName)
10 {
11 // notify user on authentication result.
12 }
13
14 function onLoginFailed(error, userContext, methodName)
15 {
16 // notify user on authentication exception.
17 }
18 </script>
The ASP.NET application is configured to use Forms Authentication. The ASP.NET AJAX authentication service is activated in the Web.config file.
You need to ensure that the following workflow is maintained:
– On successful authentication, the onLoginCompleted client-script function is called to notify the user.
– On failure of authentication, the onLoginFailed client-script function is called to display an error message.
Which code segment should you insert at line 06?
What should you do?
You are creating a Windows Forms application by using the .NET Framework 3.5. You
create a new form in your application. You add a PrintDocument control named pntDoc to
the form.To support the print functionality, you write the following code segment in the
application. (Line numbers are included for reference only.)
01 pntDoc.BeginPrint += new PrintEventHandler(PrintDoc_BeginPrint);
02 …
03 bool canPrint = CheckPrintAccessControl();
04 if (!canPrint) {
05
06 }
07
You need to ensure that the following requirements are met:
When the user has no print access, font and file stream initializations are not
executed and the print operation is cancelled.
Print operations are logged whether or not the user has print access.
What should you do?
What should you do?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The component will return custom business objects. You plan to develop a design strategy that meets the following requirements:
The component can be accessed by the .NET Windows applications and JavaScript-based Web applications. The component can be consumed by the client applications by using the minimum amount of code. The least amount of network bandwidth is consumed. You need to implement the design strategy by using the minimum amount of development effort. What should you do?
What should you do?
You have a SharePoint site collection. The default master page for the site collection displays a navigation bar on the left side of the page.
You create a custom content page.
You need to hide the navigation bar on only the custom content page.
What should you do?
Which DeviceSpecific element should you insert at line 02?
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
he application contains the following device filter element in the Web.config file.
<filter name=”isHtml” compare=”PreferredRenderingType” argument=”html32″ />
The application contains a Web page that has the following image control. (Line numbers are included for reference only.)
01 <mobile:Image ID=”imgCtrl” Runat=”server”>
02
03 </mobile:Image>
You need to ensure that the following conditions are met:
– The imgCtrl Image control displays the highRes.jpg file if the Web browser supports html.
– The imgCtrl Image control displays lowRes.gif if the Web browser does not support html.
Which DeviceSpecific element should you insert at line 02?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code segment to create a client-script function. (Line
numbers are included for reference only.)
01 function updateLabelControl(labelId, newText) {
02 var label = $find(labelId);
03 label.innerHTML = newText;
04 }
The client script function uses ASP.NET AJAX and updates the text of any Label control in
the Web form.When you test the client script function, you discover that the Label controls
are not updated. You receive the following JavaScript error message in the browser: “‘null’ is
null or not an object.” You need to resolve the error.What should you do?
Which code segment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a Windows Service environment. You need to create a Windows Service class that instantiates a service host. Which code segment should you use?
Which property tag should you add at line 07?
You develop a new publishing page layout named MyPage.aspx for a SharePoint site.
You create an Elements.xml file.
Elements.xml contains the following code segment. (Line numbers are included for reference only.)
01 <File Url=”mypage.aspx” Type=”GhostableInLibrary” IgnoreIfAlreadyExists=”TRUE”>
02 <Property Name=”Title” Value=”MyPage” />
03 <Property Name=”ContentType” Value=”$Resources:cmscore,contenttype_pagelayout_name;” />
04 <Property Name=”PublishingAssociatedContentType” Value=”; 05 #$Resources:cmscore,contenttype_page_name;;
06 #0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811;#”/>
07
08 </File>
You need to prevent users from creating pages based on the page layout.
Which property tag should you add at line 07?
Which code fragment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application consumes an ASMX Web service.
The Web service is hosted at the following URL.
http://www.contoso.com/TemperatureService/Convert.asmx
You need to ensure that the client computers can communicate with the service as part of the <system.serviceModel> configuration.
Which code fragment should you use?
What should you do?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application contains a DataSet object that has a table. The DataSet object is
as shown in the following exhibit.
You need to ensure that the application meets the following requirements without creating another table:
The DataSet can be extended by using the designer.
The application displays all product records.
The product records can be filtered by ProductID.
What should you do?