Latest MCTS 70-573 Dumps Real Exam Download 31-40

Ensurepass

QUESTION 31

You need to create a Web control that displays an ASCX control.

Which event should you use to render the Web control?

 

A. CreateChildControls

B. LoadControlState

C. SaveViewState

D. SetDesignModeState

 

Correct Answer: A

Explanation/Reference:

MNEMONIC RULE: “display ASCX control = CreateChildControl”

BaseFieldControl.CreateChildControls Method

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

microsoft.sharepoint.webcontrols.basefieldcontrol.createchildcontrols.aspx

 

 

QUESTION 32

You create a custom Web Part.

You need to ensure that a custom property is visible in Edit mode.

Which attribute should you set in the Web Part?

 

A. Personalizable

B. WebBrowsable

C. WebCategoryName

D. WebDisplayName

 

Correct Answer: B

 

Explanation/Reference:

MNEMONIC RULE: “Web Part is visible = WebBrowsable”

The WebBrowsable attribute specifies that the decorated property should appear in the editor component

of the web part. It only allows the end user to modify the property and does nothing about persistence.

WebBrowsable will make the property appear in the ToolPane or EditorPart of the WebPart.

WebBrowsable vs Personalizable in Web Parts http://stackoverflow.com/questions/4362234/webbrowsable-vs-personalizable-in-web-parts

 

 

clip_image002

 

 

QUESTION 34

You create a Visual Web Part in SharePoint Server 2010.

You need to ensure that the Web Part can access the local file system on the SharePoint server. You must

minimize the amount of privileges assigned to the Web Part.

What should you do?

 

A. Elevate the trust level to Full.

B. Elevate the trust level to WSS_Medium.

C. Create a custom code access security (CAS) policy.

D. Deploy the Web Part to the Global Assembly Cache (GAC).

 

Correct Answer: C

Explanation/Reference:

MNEMONIC RULE: “access the local file system = custom code access”

WSS_Medium will give you access to System.Security.Permissions.FileIOPermission, but it’ll also give you

access to a few other assemblies/namespaces.

If the goal is to minimize the amount of privileges, then CAS is the way to go.

Securing Web Parts in SharePoint Foundation

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

 

 

QUESTION 35

You have a custom Web Part that is deployed as a sandboxed solution.

You need to ensure that the Web Part can access the local file system on a SharePoint server. You must

minimize the amount of privileges assigned to the Web Part.

What should you do?

 

A. Elevate the trust level to Full.

B. Elevate the trust level to WSS_Medium.

C. Redeploy the Web Part as a farm solution.

D. Deploy the Web Part to the Global Assembly Cache (GAC).

Correct Answer: C

Explanation/Reference:

MNEMONIC RULE: “Redeploy”

Due to the heavy restrictions of sandboxed solutions, elevating the trust level is not an option, and neither

is the deployment of the Web Part to GAC.

You can get broader permissions by using full-trust proxies, but it’s not an option in this question. 🙂

 

 

QUESTION 36

You need to convert a user control named Control.ascx to a SharePoint Web Part. The Web Part must be packaged as a user solution.

What should you do?

 

A. Modify the SafeControls section of the web.config file.

B. Copy the Control.ascx file to the ControlTemplates folder.

C. Create a new Visual Web Part and use the existing MyControl.ascx file.

D. Create a new Web Part and reuse the code from the MyControl.ascx file.

Correct Answer: D

Explanation/Reference:

MNEMONIC RULE: “Create a new Web Part”

Since you already have a user control, you don’t need to create a Visual Web Part (by dragging-and-dropping user controls from the Toolbox).

 

 

QUESTION 37

You are creating a Web Part in SharePoint Server 2010.

You need to ensure that the Web Part can send data to another Web Part.

Which interface should you override?

 

A. IQueryable

B. ISerializable

C. IWebEditable

D. IWebPartField

 

Correct Answer: D

 

Explanation/Reference:

MNEMONIC RULE: “Web Part send data = IWebPartField”

Defines a provider interface for connecting two server controls using a single field of data.

This interface is designed to be used with Web Parts connections. In a Web Parts connection, two server controls that reside in a WebPartZoneBase zone establish a connection and share data, with one control acting as the consumer and the other control acting as a provider.

IWebPartField Interface http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartfield.aspx

 

 

QUESTION 38

You plan to create a Web Part for a SharePoint site.

You need to ensure that the Web Part can send data to other Web Parts in the site.

What should you do?

 

A. Implement the IAlertNotifyHandler interface.

B. Implement the IAlertUpdateHandler interface.

C. Create a custom interface that uses the WebBrowsable and the WebPartStorage attributes.

D. Create a custom interface that uses the ConnectionProvider and ConnectionConsumer attributes.

Correct Answer: D

Explanation/Reference:

MNEMONIC RULE: “send data = Provider/Consumer”

Connect Web Parts in SharePoint 2010 http://msdn.microsoft.com/en-us/library/ff597538.aspx

 

 

QUESTION 39

You are creating two Web Parts named WPMaster and WPDetails.

You need to ensure that when an item is selected from WPMaster, the details of the item are displayed in

WPDetails.

What should you implement in WPMaster?

 

A. ICellProvider

B. IListProvider

C. IWebPartRow

D. IWebPartTable

Correct Answer: C

Explanation/Reference:

MNEMONIC RULE: “Web Part item = IWebpartRow”

ICellProvider is now obsolete, you should use IWebPartField instead. This gives you a single field of data

to work with.

IListProvider is now obsolete, you should use IWebPartTable instead.

IWebPartTable gives you an entire table of data.

Defines a provider interface for connecting two server controls using a single row of data.

IWebPartRow Interface

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartrow.aspx

 

 

QUESTION 40

You need to send a single value from a consumer Web Part to a provider Web Part. Which interface should you use?

 

A. IAlertNotifyHandler

B. IWebPartField

C. IWebPartParameters

D. IWebPartRow

 

Correct Answer: B

 

Explanation/Reference:

MNEMONIC RULE: “single value = field”

Defines a provider interface for connecting two server controls using a single field of data.

This interface is designed to be used with Web Parts connections. In a Web Parts connection, two server controls that reside in a WebPartZoneBase zone establish a connection and share data, with one control acting as the consumer and the other control acting as a provider.

IWebPartField Interface http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartfield.aspx

 

Download Lates MCTS 70-573 Real Free Tests , help you to pass exam 100%.