What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add a Web page named HomePage.aspx in the application. The Web page contains different
controls. You add a newly created custom control named CachedControl to the Web page.
You need to ensure that the following requirements are met:
The custom control state remains static for one minute.
The custom control settings do not affect the cache settings of other elements in the Web page.
What should you do?
What should you do?
You are creating ASP.NET applications by using the .NET Framework 3.5.
The application has two tables named Products and ProductPrice.
The application retrieves and stores data from the Product table into a Dataset object.
The application uses the DataSet object to modify and update the data that is retrieved.
The update command for the related SqlDataAdapter class is generated automatically by using a SqlCommandBuilder object.
You plan to retrieve and modify data from the Product and ProductPrice tables as a unit.
You need to ensure that the application can update the data in the tables. What should you do?
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 fragment should you insert at line 11?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to the Web.config file of the application (Line numbers are included for reference only).
01 <healthMonitoring>
02 <providers>
03 <add name=”EventLogProvider”
04 type=”System.Web.Management.EventLogWebEventProvider
05 />
06 <add name=”WmiWebEventProvider”
07 type=”System.Web.Management.WmiWebEventProvider
08 />
09 </providers>
10 <eventMappings>
11
12 </eventMappings>
13 <rules>
14 <add name=”Security Rule” eventName=”Security Event”
15 provider=”WmiWebEventProvider” />
16 <add name=”AppError Rule” eventName=”AppError Event”
17 provider=”EventLogProvider” />
18 </rules>
19 </healthMonitoring>
You need to configure Web Events to meet the following requirements:
* Security-related Web Events are mapped to Microsoft Windows Management Instrumentation (WMI) events.
* Web Events caused by problems with configuration or application code are logged into the Windows Application Event Log.
Which code fragment should you insert at line 11?
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?
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 use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.
<asp:ListBox SelectionMode=”Multiple” ID=”ListBox1″ runat=”server”></asp:ListBox>
<asp:ListBox ID=”ListBox2″ runat=”server”></asp:ListBox>
<asp:Button ID=”Button1″ runat=”server” Text=”Button” onclick=”Button1_Click” />
You need to ensure that when you click the Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control.
Which code segment should you use?
Which code fragment should you insert at line 11?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to the Web.config file of the application (Line numbers are included for reference only).
01 <healthMonitoring>
02 <providers>
03 <add name=”EventLogProvider”
04 type=”System.Web.Management.EventLogWebEventProvider
05 />
06 <add name=”WmiWebEventProvider”
07 type=”System.Web.Management.WmiWebEventProvider
08 />
09 </providers>
10 <eventMappings>
11
12 </eventMappings>
13 <rules>
14 <add name=”Security Rule” eventName=”Security Event”
15 provider=”WmiWebEventProvider” />
16 <add name=”AppError Rule” eventName=”AppError Event”
17 provider=”EventLogProvider” />
18 </rules>
19 </healthMonitoring>
You need to configure Web Events to meet the following requirements:
* Security-related Web Events are mapped to Microsoft Windows Management Instrumentation (WMI) events.
* Web Events caused by problems with configuration or application code are logged into the Windows Application Event Log.
Which code fragment should you insert at line 11?
What should you do?
You are creating an ASP.NET application by using the .NET Framework 3.5.
Airline passengers access the application over the Internet and from airport kiosks around the world.
The airport kiosks do not allow users to modify browser settings.
You have created language-specific resources for all static text elements in the application.
You need to ensure that the content is displayed in the preferred language of the users, regardless of their physical location.
What should you do?