Microsoft EXAM 70-562 Online Test

You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5. The computer that hosts the ASP.NET Web application contains a local instance of Microsoft SQL Server 2005. The instance uses Windows Authentication. You plan to configure the membership providers and the role management providers. You need to install the database elements for both the providers on the local computer. What should you do?


You create a Web application by using Microsoft ASP.NET 3.5. You are not using

an exception management framework in the application. However, the

application must automatically log all unhandled exceptions to the event log.

You need to configure the Web.config file accordingly.

Which configuration should you use?


You create a Web site by using Microsoft ASP.NET 3.5. You create the following class

in a separate code file:

public static class ChartColors

{

public static Color NormalActivityColor = Color.Green;

public static Color WarningActivityColor = Color.Yellow;

public static Color ErrorActivityColor = Color.Red;

public static Color GetRandomColor()

{

Random random = new Random((int)DateTime.Now.Ticks);

int randomArgbValue = random.Next();

Color color = Color.FromArgb(255, Color.FromArgb(randomArgbValue));

return color;

}

}

You need to configure the Web site project so that this class can be consumed by the

Web site.

What should you do?


You create a Web application by using Microsoft ASP.NET 3.5. The following

markup exists on a page:

<asp:TextBox ID="_titleTextBox" runat="server"/>

<asp:Button ID="_button" runat="server" Text="Filter"/>

<asp:SqlDataSource ID="_bookDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Publishing %>" SelectCommand="GetBooks" SelectCommandType="StoredProcedure" FilterExpression="Active=1 AND Title LIKE '{0}%'">

<FilterParameters>

<asp:ControlParameter ControlID="_titleTextBox"/>

</FilterParameters>

</asp:SqlDataSource>

<asp:GridView ID="_bookGridView" runat="server" DataSourceID="_bookDataSource"/>

The page retrieves all books in the company's database and displays only the active books. The TextBox control allows you to also filter books by title. When you click the Filter button and do not specify a title, the page does not filter by active books. It displays all books retrieved from the database. If you do not specify a title, you want the page to display only active books.

You need to solve this problem. What should you do?


You create a Web application by using Microsoft ASP.NET 3.5. The following HTML element exists on an ASP.NET page:

<input type="hidden" name="HiddenField"/>

You need to retrieve the value of the element in the code-behind class.

Which code segment should you use? (Each correct answer presents a complete solution.


You create a Web application by using Microsoft ASP.NET 3.5. An Extensible

Markup Language (XML) Web service is defined as follows:

[WebService]

public class PhoneService : WebService

{

[WebMethod]

public string[] GetAvailableNumbers()

{

// Some Code

}

}

You use Microsoft Visual Studio 2008 to add a Web reference named TelephoneServices to the application's project.

You need to call the GetAvailableNumbers Web method from a page.

Which code segment should you use?


You create a Web application by using Microsoft ASP.NET 3.5. The application is hosted on a Web farm, and it uses in-process session state. It is not guaranteed that a user will remain connected to the same Web server across multiple requests.

A Web page contains the following code (line numbers are included forreference only):

01 protected void Page_Load(object sender, EventArgs e)

02 {

03 String connStr =

WebConfigurationManager.ConnectionStrings[0].ConnectionString;

04 using (SqlConnection conn = new SqlConnection(connStr))

05 {

06 SqlCommand cmd = new SqlCommand("GetExams", conn);

07 SqlDataAdapter adapter = new SqlDataAdapter(cmd);

08 DataSet ds = new DataSet();

09 adapter.Fill(ds);

10

11 if (Request.QueryString["Process"] == Boolean.TrueString)

12 {

13

14 }

15 }

16 }

This code fills a DataSet instance with exam information from a Microsoft SQL Server database. If a query string parameter named Process has the value True, you need to have a page named ExamProcesser.aspx access the data in

the DataSet instance.

You need to add code at line 13 to accomplish your goal.

Which code segment should you use?


You create a Web application by using Microsoft ASP.NET 3.5. You create a page named GenericError.aspx that displays a message to the user when an unhandled exception occurs. Most users access the application at http://www.bcdtrain.com/Crm. If the user accesses the application at http://127.0.0.1/Crm, the application must display an automatically generatedpage containing the stack trace when an unhandled exception occurs.

You need to configure the Web.config file accordingly.

Which configuration should you use?


You create a Web application by using Microsoft ASP.NET 3.5. You add a thefollowing code to a generic handler file named ValidationHandler.ashx (line numbers are included for reference only):

01 public class ValidationHandler : IHttpHandler

02 {

03 public void ProcessRequest(HttpContext context)

04 {

05 Bitmap validationBitmap = (Bitmap)Session["ValidationImage"];

06

07 }

08 public bool IsReusable

09 {

10 get

11 {

12 return false;

13 }

14 }

15 }

You need to render the validationBitmap instance as a JPEG image when the ValidationHandler.ashx is requested.

Which code segment should you add at line 06?


You create a Web application by using Microsoft ASP.NET 3.5. The application uses diagnostic tracing to log unhandled exceptions. A page contains the following markup:

<asp:ScriptManager ID="_scriptManager" runat="server"/>

<asp:UpdatePanel ID="_udpatePanel" runat="server">

<asp:Button ID="_button" runat="server" Text="Process"/>

</asp:UpdatePanel>

When you click the Button control an unhandled exception occurs. However,the exception does not get logged.

You need to configure the application so that the unhandled exception produced by clicking the Button control gets logged.

What should you do?
































































































































Description:

TS: Microsoft .NET Framework 3.5, ASP.NET Application Development

The Microsoft Certified Professional Developer (MCPD) certification validates a comprehensive set of skills that are necessary to develop applications successfully by using Microsoft Visual Studio, the Microsoft .NET Framework, and other development technologies. The MCPD certification is designed to provide hiring managers with a strong indicator of your potential job success. It requires two to three years of relevant experience and a commitment to remaining current in best practices and technologies.

Discussion

Your Facebook Friends on WizIQ