Which code segment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will contain an enumeration named OrderState. The OrderState enumeration will contain the following four values:
Processing
Cancelled
Confirmed
Closed
The client application must be able to set the state of an Order entity to only the following two values:
Cancelled
Closed
You need to create the data contract for OrderState. Which code segment should you use?
Which method should you use?
You are creating an ASP.NET application by using the .NET Framework 3.5.
You create an AJAX Web form in the application.
You create an ASP.NET AJAX client-component class in the Web form.
The class will be used in a JavaScript function in the Web form.
You plan to debug the JavaScript function.
You need to display all the fields of the AJAX client-component object in the trace console in the Web form by using the minimum amount of code.
Which method should you use?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You create a Web form by using ASP.NET AJAX.You write the following
client-script code fragment to handle the exceptions thrown from asynchronous postbacks.
(Line numbers are included for reference only.)
01 <script type=”text/javascript”>
02 function pageLoad()
03 {
04 var pageMgr =
05 Sys.WebForms.PageRequestManager.getInstance();
06
07 }
08
09 function errorHandler(sender, args)
10 {
11
12 }
13 </script>
You need to ensure that the application performs the following tasks:
Use a common client-script function named errorHandler.
Update a Label control that has an ID named lblError with the error message.
Prevent the browser from displaying any message box or Javascript error.
What should you do?
Which code segment should you insert at line 05?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You create the following service contract. (Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IMyService
03 {
04 [OperationContract]
06 List<string> GetData(int index);
07 }
You need to ensure that the GetData operation can be accessed by using the URI in the following manner:
GetData/1 for the index value 1
GetData/2 for the index value 2
..
GetData/n for the index value n
Which code segment should you insert at line 05?
Which code segment should you insert at line 04?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom Web user control named SharedControl. The control will be compiled as a library.
You write the following code segment for the SharedControl control. (Line numbers are included for reference only.)
01 protected override void OnInit(EventArgs e)
02 {
03 base.OnInit(e);
04
05 }
All the master pages in the ASP.NET application contain the following directive.
<%@ Master Language=”C#” EnableViewState=”false” %>
You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.
Which code segment should you insert at line 04?
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 add?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You have successfully defined a service contract named IManageOrders. You write the following code segment.
public class OrderImpl : IManageOrders {
public void MarkOrderClosed(int orderId){
try {
…
}
catch (SqlException exc){
throw new FaultException<DataFault>(new DataFault()); }}}
[DataContract]
public class DataFault {
}
You need to create a fault contract for the MarkOrderClosed method on the IManageOrders service contract. Which code segment should you add?
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?
What should you do?
You create a Microsoft ASP.NETWeb application by using the Microsoft .NET Framework
version 3.5.You add the following code fragment to an AJAX-enabled Web form. (Line
numbers are included for reference only.)
01 <asp:ScriptManager ID=”scrMgr” runat=”server” />
02 <asp:UpdatePanel ID=”updPanel” runat=”server”
03 UpdateMode=”Conditional”>
04 <ContentTemplate>
05 <asp:Label ID=”lblTime” runat=”server” />
06 <asp:UpdatePanel ID=”updInnerPanel”
07 runat=”server” UpdateMode=”Conditional”>
08 <ContentTemplate>
09 <asp:Timer ID=”tmrTimer” runat=”server”
10 Interval=”1000″
11 OnTick=”tmrTimer_Tick” />
12 </ContentTemplate>
13
14 </asp:UpdatePanel>
15 </ContentTemplate>
16
17 </asp:UpdatePanel>
The tmrTimer_Tick event handler sets the Text property of the lblTime Label control to the
current time of the server.You need to configure the appropriate UpdatePanel control to
ensure that the lblTime Label Control is properly updated by the tmrTimer Timer control.
What should you do?
What should you do to ensure that the requirements shown in the following table are met?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code fragment. (Line numbers are included for reference
only.)
01 <asp:UpdatePanel ID=”upnData” runat=”server”
02 ChildrenAsTriggers=”false” UpdateMode=”Conditional”>
03 <Triggers>
04
05 </Triggers>
06 <ContentTemplate>
07 <!– more content here –>
08 <asp:LinkButton ID=”lbkLoad” runat=”server” Text=”Load”
09 onclick=”lbkLoad_Click” />
10 <asp:Button ID=”btnSubmit” runat=”server” Text=”Submit”
11 Width=”150px” onclick=”btnSubmit_Click” />
12 </ContentTemplate>
13 </asp:UpdatePanel>
14 <asp:Button ID=”btnUpdate” runat=”server” Text=”Update”
15 Width=”150px” onclick=”btnUpdate_Click” />
You need to ensure that the requirements shown in the following table are met. What should you do?