You need to display the Error.aspx page if an unhandled error occurs on any page within the site
You are implementing an ASP.NET Web site.
The root directory of the site contains a page named Error.aspx.
You need to display the Error.aspx page if an unhandled error occurs on any page within the site.
You also must ensure that the original URL in the browser is not changed.
What should you do?
Which code segment should you use?
You are implementing an ASP.NET Web site.
The site uses a component that must be dynamically configured before it can be used within site pages.
You create a static method named SiteHelper.Configure that configures the component.
You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first
time, and only the first time, that any page in thesite is requested.
Which code segment should you use?
Which two actions should you perform?
You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project.
The service includes a method named GetPeople that takes no arguments and returns an array of Person
objects.
The ASP.NET application uses a proxy class to access the service.
You use the Add Service Reference wizard to generate the class.
After you create the proxy, you move the service endpoint to a different port.
You need to configure the client to use the new service address.
In addition, you must change the implementation so that calls to the client proxy will return a List<Person>
instead of an array.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)
Which configuration should you use in web.config?
You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations.
Each location will specify its SMTP configuration settings in a separate file named smtp.config in theroot folder
of the Web site.
You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the
Web site.
Which configuration should you use in web.config?
You need to log health-monitoring events with severity level of error to the Windows application eventlog
You deploy an ASP.NET application to an IIS server.
You need to log health-monitoring events with severity level of error to the Windows application eventlog.
What should you do?
Which code segment should you use?
You are implementing an ASP.NET page.
The page includes a method named GetCustomerOrderDataSet that returns a DataSet.
The DataSet includes a DataTable named CustomerDetailsTable and a DataTable named OrderDetailsTable.
You need to display the data in OrderDetailsTable in a DetailsView control named dtlView.
Which code segment should you use?
You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductI
You are implementing an ASP.NET page.
You add and configure the following ObjectDataSource.
<asp:ObjectDataSource SelectMethod=”GetProductByProductId” ID=”odc”
runat=”server” TypeName=”ProductDAL”>
<SelectParameters>
<asp:Parameter Name=”productId” Type=”Int32″ />
</SelectParameters>
</asp:ObjectDataSource>
The page will be called with a query string field named pid.
You need to configure the ObjectDataSource control to pass the value of the pid field to
GetProductsByProductId method.
What should you do?
You need to cache the retrieved data so that the database is not queried each time the Web page is accessed
You are implementing an ASP.NET Web application that retrieves data from a Microsoft SQL Server database.
You add a page that includes the following data source control.
<asp:SqlDataSource id=”sqlds” runat=”server” ConnectionString=”<%$
ConnectionStrings:MyDB %>” SelectCommand=”SELECT * FROM Companies” />
The page is accessed frequently, but the data in the database rarely changes.
You need to cache the retrieved data so that the database is not queried each time the Web page is accessed.
What should you do?
Which code segment should you use?
You are implementing an ASP.NET page.
Client-side script requires data.
Your application includes a class named Person witha Name property of type string.
The code-behind file of the page includes the following code segment.
public string JsonValue;
List<Person> people = GetPeopleList();
JavaScriptSerializer json = new JavaScriptSerializer();
You need to use the JavaScriptSerializerclass to serialize only the Name property of each item in the people
list.
Which code segment should you use?
Which code segment should you use?
You are implementing an ASP.NET application that uses LINQ to Entities to access and update the database.
The application includes the following method to update a detached entity of type Person.
private NorthwindContext _entities;
public void UpdatePerson(Person personToEdit)
{
}
You need to implement the UpdatePerson method to update the database row that corresponds to the
personToEdit object.
Which code segment should you use?