Ensurepass

QUESTION 241

You are developing an ASP.NET MVC 2 Web Application. You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization. Which code segment should you use?

 

A.

public class AccountingController : Controller

{

public void ExportAsync() {…}

[Authorise]

public void ExportCompleted() {…}

}

B.

public class AccountingController : AsyncController {

[Authorise]

public void ExportAsync() {…}

public void ExportCompleted() {…}

}

C.

public class AccountingController : AsyncController {

[Authorise]

public void Export() {…}

}

D.

public class AccountingController : Controller


{

[Authorise]

public void ExportAsync() {…}

[Authorise]

public void ExportCompleted() {…}

}

 

Correct Answer: B

 

 

QUESTION 242

You are developing an ASP.NET Web page that uses jQuery validation.

 

The user should enter a valid email address in a text box that has ID txtEmail. The page must display “E-Mail address required” when the user does not enter an address and “Invalid e-mail address” when the user enters an address that is not formatted properly.

 

You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address.

 

Which two code segments should you add? (Choose 2)

 

A.

txtEmail:

{

messages:

{

required: “E-mail address required”,

email: “Invalid e-mail address”

}

}

B.

messages:

{

txtEmail:

{

required: “E-mail address required”,

email: “Invalid e-mail address”

}

}

C.

txtEmail:

{

rules:

{

required: true

email: true

}

}

D.

rules:

{

txtEmail:

{

required: true

email: true

}

}

 

Correct Answer: BD

Explanation:

http://www.dotnetcurry.com/ShowArticle.aspx?ID=310

 

 

QUESTION 243

You create an ASP.NET server control in the SampleControl namespace. The control uses a JavaScript file names Refresh.js to implement AJAX functionality. You need to ensre that the JavaScript file is included in the assembly. Which two actions should you perform (Choose 2)

 

A.

Add the following assembly attribute to the AssemblyInfo file. [assembly: WebResource(“SampleControl.Refresh.js”, “application/x-javascript”)]

B.

Add the following assembly attribute to the AssemblyInfo file. [assembly:ScriptResource(“SampleControl.Refresh.js”)]

C.

In the Properties window for the Refresh.js file, set the Build Action to Embedded Resource.

D.

In the Properties window for the Refresh.js file, set the Build Action to Content.

 

Correct Answer: AC

Explanation:

from vs metadata

// Summary:

// Defines a resource in an assembly to be used from a client script file. This // class cannot be inherited.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class ScriptResourceAttribute : Attribute

 

 

QUESTION 244

You are developing a WCF service. The service includes an operation names GetProduct. You need to ensure that GetProduct will accept a POST request and will indicate that the returned data is XML. Which two actions should you perform (Choose 2)

 

A.

Add the WebGet attribute to the service contract.

B.

Set WebOperationContext.Current.OutgoingRequest.ContentType to “text/xml” in the GetProduct method.

C.

Add the WebInvoke attribute to the service contract.

D.

Set WebOperationContext.Current.OutgoingResponse.ContentType to “text/xml” in the GetProduct method.

 

Correct Answer: CD

 

 

QUESTION 245

ASP.net MVC dotn display a column

 

Using LINQ to SQL class

 

[MetadataType(typeof(ProductMetadata))]

 

public pertial class Product

 

{

 

 

}

 

public class ProductMetadata

 

{

 

 

}

 

A.

Add the following attribute to Product class

[DisplayColumn(“DiscontinueDate”,”DiscontinueDate”,false)

B.

Add the following attribute to ProductMetadata class [DisplayColumn(“DiscontinueDate”,”DiscontinueDate”,false)

C.

Add the following code segment Product class

public bool ScaffoldDisable()

{

return false;

}

D.

ProductMetaData class

[ScaffoldColumn(false)]

public object DiscontinueDate;

 

Correct Answer: D

 

 

QUESTION 246

You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file?

 

A.

<authorization>

<deny verbs=”GET” users=”*”/>

<allow verbs=”POST” users=”Moderator”/>

<deny verbs=”POST” users=”*”/>

</authorization>

B.

<authorization>

<deny verbs=”POST” users=”*”/>

<allow verbs=”POST” users=”Moderator”/>

<allow verbs=”GET” users=”*”/>

</authorization>

C.

<authorization>

<allow verbs=”GET” users=”*”/>

<allow verbs=”POST” users=”Moderator”/>

<deny verbs=”POST” users=”*”/>

</authorization>

D.

<authorization>

<allow verbs=”GET” users=”*”/>

<deny verbs=”POST” users=”Moderator”/>

<deny verbs=”POST” users=”*”/>

</authorization>

 

Correct Answer: C

 

 

QUESTION 247

You are developing an ASP.NET Web application. The application must pass an object that contains user-specific data between multiple pages. The object ismore than 100 KB in size when serialized.You need to minimize the amount of data is sent to the user.What should you do?

 

A.

Pass the object data in a hidden field.

B.

Store the object instance in a session variable.

C.

Use a cookie that contains the object data.

D.

Encode the object data and pass it in a query string parameter.

 

Correct Answer: B

Explanation:

Session variables are stored in the server

 

 

QUESTION 248

Migration .net 3.5 to 4.0

 

You have migrated a web application from .net 3.5 to 4.0. the application hat to render same as in .net 3.5.

 

A.

<assembles> someoptions </assembles>

B.

<pages controlRenderingCompatibilityVersion=”3.5″/>

C.

<compilation targetframework = “3.5” />

D.

<xhtmlConformance mode=”Legacy” />

 

Correct Answer: B

Explanation:

http://msdn.microsoft.com/en-us/library/dd483478.aspx

QUESTION 249

A library called contosobuisness.dll has been created and u need to accept it in a page..

 

all options had the <%assembly tag but the att differed

 

A.

<%assembly TargetName=”contosobuisness” %>

B.

<%assembly ID=”contosobuisness” %>

C.

<%@ Assembly Name=”contosobuisness” %>

D.

<%assembly virtualpath=”contosobuisness” %>

 

Correct Answer: C

Explanation:

<%@ Assembly Name=”” Src =”” %>

 

 

QUESTION 250

A text box should enter valid date options all were compare validators but the operator differed (equal and datatyp)..controltovalidate in two options and controltocompare in the remainin..

 

A.

<asp:CompareValidator ID=”CompareValidator1″ runat=”server” Operator=”DataTypeCheck”

Type=”Date”></asp:CompareValidator>

B.

<asp:CompareValidator ID=”CompareValidator1″ runat=”server” Operator=”Equal” Type=”Date”></asp:

CompareValidator>

C.

<asp:CompareValidator ID=”CompareValidator1″ runat=”server” Operator=”LessThan” Type=”Date”></asp:

CompareValidator>

D.

<asp:CompareValidator ID=”CompareValidator1″ runat=”server” Operator=”DataTypeCheck”

Type=”Double”></asp:CompareValidator>

 

Correct Answer: A

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-515 Real Exam

Instant Access to Try Microsoft 70-515 Free Demo

Comments are closed.