[Pass Ensure VCE Dumps] Testing PassLeader 70-573 Exam Questions and Answers To 100% Pass 70-573 Exam (101-120)

Where Download New Free 70-573 Exam Dumps? As we all konw that new 70-573 exam is difficult to pass, if you cannot get the valid 70-573 exam questions, you will fail the 70-573 exam, but DO NOT WORRY! Nowdays, PassLeader has published the newest 285q 70-573 vce dumps and pdf dumps, in PassLeader’s new 285q 70-573 braindumps, you can get all the new questions and answers, it is 100% vaild and will help you achieving 70-573 exam certification quickly.

keywords: 70-573 exam,285q 70-573 exam dumps,285q 70-573 exam questions,70-573 pdf dumps,70-573 vce dumps,70-573 study guide,70-573 practice test,TS: Microsoft SharePoint 2010, Application Development Exam

QUESTION 101
You have a document library named Documents. Minor and major version management is enabled for the document library. You plan to add a document named MyFile.docx to Documents. You create a console application that contains the following code segment. (Line numbers are included for reference only.)
01 using (SPSite site = new SPSite(“http://intranet”))
02 {
03 SPList documents = site.RootWeb.Lists[“Documents”];
04 FileStream fstream = File.OpenRead(@”MyFile.docx”);
05 byte[] content = new byte[fstream.Length];
06 fstream.Read(content, 0, (int)fstream.Length);
07 fstream.Close();
08 site.RootWeb.Files.Add(documents.RootFolder.Url + “/MyFile.docx”, content, true);
09 SPFile file = site.RootWeb.GetFile(documents.RootFolder.Url + “/MyFile. docx”);
10 file.CheckIn(string.Empty);
11
12 }
You need to ensure that all users can see the document. Which code segment should you add at line 11?

A.    file.CanOpenFile(true);
B.    file.Publish(string.Empty);
C.    file.ReleaseLock(string.Empty);
D.    file.Update();

Answer: B
Explanation:
MNEMONIC RULE: “Minor and major versions to Publish”
Minor and major version management is enabled for the document library; therefore, we must use Publish()method.
SPFile.Publish Method
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.publish.aspx

QUESTION 102
You create a Microsoft .NET Framework console application that uses a Representational State Transfer (REST) API to query a custom list named Products. The application contains the following code segment.
AdventureWorksDataContext codc = new AdventureWorksDataContext(new Uri(“http://contoso/_vti_bin/listdata.svc”));
codc.Credentials = CredentialCache.DefaultCredentials;
You need to read all items in Products into an object. Which method should you use?

A.    code.Products.ToList
B.    code.Products.All
C.    code.Products.AsQueryable
D.    code.Products.ElementAt

Answer: A
Explanation:
MNEMONIC RULE: “read all items ToList”
Interacting with SharePoint 2010 lists using REST, ASP.NET and ADO.NET Data Services
http://extendtheenterprise.com/2010/11/03/using-sharepoint-2010-rest-apis-in-asp-net/
Enumerable.ToList<TSource> Method
http://msdn.microsoft.com/en-us/library/bb342261.aspx

QUESTION 103
You have a helper method named CreateSiteColumn that contains the following code segment.
static void CreateSiteColumn ( SPWeb web, string columnName )
{
}
You need to add a new site column of type Choice to a SharePoint site by using the helper method. Which code segment should you include in the helper method?

A.    SPField field = new SPFieldChoice(System.web.Lists[0].Fields, columnName);
B.    web.Fields.Add(columnName, SPFieldType.Choice, true);
C.    web.Lists[0].Fields.Add(columnName, SPFieldType.Choice, True);
D.    web.Lists[0].Views[0].ViewFields.Add(columnName);

Answer: B
Explanation:
MNEMONIC RULE: “web.Fields.Add”
SPFieldCollection.Add Method (String, SPFieldType, Boolean)
http://msdn.microsoft.com/en-us/library/ms472869.aspx

QUESTION 104
You have a custom user profile property named MyProperty. You need to create a Web Part that displays the value of MyProperty for the current user. Which code segment should you use?

A.    string profile = SPContext.Current.Web.Properties(“CurrentUser/MyProperty”);
B.    string profile = SPContext.Current.Web.Users[“MyProperty”].ToString();
C.    UserProfileManager profileManager = new UserProfileManager(SPServiceContext.Current);
UserProfile userProfile = profileManager.GetUserProfile(SPContext.Current.Web. CurrentUser.LoginName);
string profile = userProfile[“MyProperty”].ToString();
D.    UserProfileManager profileManager = new UserProfileManager(SPServiceContext.Current);
UserProfile userProfile = profileManager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName);
string profile = userProfile.Properties.GetPropertyByName(“MyProperty”).ToString();

Answer: D
Explanation:
MNEMONIC RULE: GetPropertyByName
userProfile.Properties is ProfileSubtypePropertyManager object.
See its members in this MSDN article:
ProfileSubtypePropertyManager Members
http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.profilesubtypepropertymanager_members.aspx
See the sample code at the link below.
Creating profile properties and sections the SharePoint 2010 way-part 2, The code
http://pholpar.wordpress.com/2010/03/17/creating-profile-properties-and-sections-the-sharepoint-2010-waypart-2-the-code/

QUESTION 105
You have a SharePoint Web application that has the URL http://intranet. You are creating a Microsoft .NET Framework application that will display the title of the SharePoint site and will execute outside of the SharePoint server. You create a textbox named textBoxTitle. You write the following code segment. (Line numbers are included for reference only.)
01 ClientContext context = new ClientContext(“http://intranet”);
02
03 Web site = context.Web;
04 context.Load(site) ;
05
06 textBoxTitle.Text = site.Title;
You discover that line 0 6 generates an error. You need to ensure that the .NET application displays the title of the SharePoint site in textBoxTitle. What should you do?

A.    Add the following line of code at line 02.
context.ExecuteQuery() ;
B.    Add the following line of code at line 05.
context.ExecuteQuery();
C.    Add the following line of code at line 05.
context.ValidateOnClient = true;
D.    Add the following line of code at line 02.
context-ValidateOnClient = true;

Answer: B

QUESTION 106
You are creating a custom content type named CT1. You need to use a Feature to add an existing site column named SiteCol1 to CT1. Which code segment should you include in the Feature?

A.    <Field ID=”SiteCol1″/>
B.    <Field ID=”{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}” Name=”SiteCol1″/>
C.    <FieldRef ID=”SiteCol1″ Name=”{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}”/>
D.    <FieldRef ID=”{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}” Name=”SiteCol1″/>

Answer: D
Explanation:
MNEMONIC RULE: “existing Field needs to be Referenced”
FieldRef Element (ContentType)
http://msdn.microsoft.com/en-us/library/aa543225.aspx

QUESTION 107
You create a Web Part. You need to display the number of visits to a SharePoint site collection in a label named LblVisits. You write the following code segment. (Line numbers are included for reference only.)
01 SPSecurity.RuntfithElevatedPrivileges (delegate()
02 {
03 try
04 {
05
06 LblVisits.Text = site.Usage.Visits.ToString () ;
07 }
08 finally
09 {
10
11 }
12 }
13 );
Which code segment should you add at line 05?

A.    SPSite site – SPContext.GetContext (HttpContext.Current ).Site;
B.    SPSite site = new SPSite (SPContext.Current.Site.ID );
C.    SPSite site = SPContext.Current.Site;
D.    SPSite site – SPControl.GetContextSite (HttpContext.Current );

Answer: B

QUESTION 108
You plan to create a custom Web Part that displays items from a custom SharePoint list named Project. You need to ensure that you can access the list by using strongly-typed objects in Microsoft Visual Studio 2010. What should you do first?

A.    Edit the web.config file.
B.    Run spmetal.exe.
C.    Run ecmangen.exe.
D.    Edit the Manifest.xml file.

Answer: B
Explanation:
MNEMONIC RULE: “strongly-typed = spmetal.exe”
The LINQ to SharePoint provider is a new feature in SharePoint 2010 that allows you to use a strongly-typedentity model and the language integrated query (LINQ) query syntax to query list data. Essentially, LINQ toSharePoint hides the complexity of developing CAML queries from developers, which can reduce developmenttime and make code more readable. The LINQ to SharePoint provider converts the LINQ expressions into CAML queries at run time. Although you can manually develop your entity classes, in most cases, you will want to use the SPMetalcommand line tool.
Using LINQ to SharePoint
http://msdn.microsoft.com/en-us/library/ff798478.aspx

QUESTION 109
You need to create a Web Part that displays all of the content created by a specific user. You write the following code segment. (Line numbers are included for reference only.)
01 Dim kRequest As New KeywordQuery(ServerContext.Current)
02
03 kRequest.QueryText = strQuery
04 Dim resultTbls As ResultTableCollection = kRequest.Execute()
Which code segment should you add at line 02?

A.    Dim strQuery As String = “author:” & searchAuthor
B.    Dim strQuery As String = “docID:” & searchAuthor
C.    Dim strQuery As String = “SELECT Title, Rank, Write, Url FROM SCOPE() WHERE author = ” & searchAuthor
D.    Dim strQuery As String = “SELECT Title, Rank, Write, Url FROM SCOPE() WHERE docID = ” & searchAuthor

Answer: A

QUESTION 110
You create two custom lists named Offices and Rooms.
Rooms has the following columns:
Offices thas the following columns:
You need to perform a Representational State Transfer (REST) query that returns a list of all the offices that have rooms with a capacity of 10. The query results must include the room titles and the equipment in each room. Which URL should you choose?

A.    /_vti_bin/ListData.svc/Offices $expand=Rooms&$filter=Rooms/Capacity eq 10
B.    /_vti_bin/ListData.svc/Offices &$filter=Rooms/Capacity eq 10
C.    /_vti_bin/ListData.svc/Rooms $expand=Offices&$filter=Rooms/Capacity eq 10
D.    /_vti_bin/ListData.svc/Rooms &$filter=Offices/Capacity eq 10

Answer: A
Explanation:
MNEMONIC RULE: “Offices-Rooms-Rooms/Capacity”
You can use the Expand method to navigate from one entity to a related entity. You can append query strings to the URLs in order to specify filter criteria or query logic.
Using the REST Interface
http://msdn.microsoft.com/en-us/library/ff798339.aspx


http://www.passleader.com/70-573.html

QUESTION 111
You create a Web Part that programmatically updates the description of the current SharePoint site. The Web Part contains the following code segment. (Line numbers are included for reference only.)
01 RunWithElevatedPrivileges(EvelateSub)
02 Private Sub ElevatedSub()
03 Dim currSite As SPSite = SPContext.Current.Site
04 Dim currWeb As SPWeb = SPContext.Current.Web
05 Using eSite As New SPSite(currSite.ID)
06 Using eWeb As SPWeb = eSite.OpenWeb(currWeb.ID)
07 eWeb.AllowUnsafeUpdates = True
08 currWeb.Description = “Test”
09 currWeb.Update()
10 eWeb.AllowUnsafeUpdates = False
11 End Using
12 End Using
Users report that they receive an Access Denied error message when they use the Web Part. You need to ensure that all users can use the Web Part to update the description of the current site. What should you do?

A.    Remove lines 07 and 10.
B.    Remove lines 08 and 09.
C.    Change lines 08 and 09 to use the eWeb variable.
D.    Change lines 07 and 10 to use the currWeb variable.

Answer: C

QUESTION 112
You create a Web Part that queries a list. The Web Part contains the following code segment. (Line numbers are included for reference only.)
01 Protected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter)
02 Dim spInToken As SPUserToken = GetTheContext(SPContext.Current.Site)
03 Using aSite As New SPSite(curSiteCtx.ID, spInToken)
04 …
05 End Using
06 End Sub
07 Private Function GetTheContext(ByVal nWeb As SPSite) As SPUserToken
08 nWeb.CatchAccessDeniedException = False
09 Dim spToken As SPUserToken = Nothing
10 Try
11 spToken = nWeb.SystemAccount.UserToken
12 Catch generatedExceptionName As UnauthorizedAccessException
13
14 End Try
15 Return spToken
16 End Function
You need to ensure that users without permissions to the list can view the contents of the list from the Web Part. Which code segment should you add at line 13?

A.    SPSecurity.RunWithElevatedPrivileges(EvelvatedSub)
Private Sub ElevatedSub()
Using eSite As New SPSite(nWeb.ID)
spToken = nWeb.SystemAccount.UserToken
End Using
End Sub
B.    SPSecurity.RunWithElevatedPrivileges(EvelvatedSub)
Private Sub ElevatedSub()
Using eSite As New SPSite(nWeb.ID)
spToken = SPContext.Current.Web.CurrentUser.UserToken
End Using
End Sub
C.    spToken = nWeb.RootWeb.AllUsers(SPContext.Current.Web.Name).UserToken
D.    spToken = nWeb.RootWeb.AllUsers(SPContext.Current.Web.Name).UserToken

Answer: A

QUESTION 113
You need to create a custom content type and specify the content type ID. What should you do?

A.    Create a new module.
B.    Create a custom Feature.
C.    Call the Lists Web service.
D.    Call the Webs Web service.

Answer: B
Explanation:
MNEMONIC RULE: “custom Feature for custom content type”
Create Custom Content Types in SharePoint 2010
http://msdn.microsoft.com/en-us/library/ff630942.aspx

QUESTION 114
You need to delete the previous versions of all documents in a document library. The deleted versions of the documents must be retained in the SharePoint Recycle Bin. What should you do?

A.    For the document library, call the Recycle method.
B.    For the document library, call the Delete method.
C.    For each document, call the DeleteAll method of the Versions property.
D.    For each document, call the RecycleAll method of the Versions property.

Answer: D
Explanation:
MNEMONIC RULE: “all previous versions to Recycle Bin = RecycleAll of the Versions”
Recycles the version collection except for the current version.
SPListItemVersionCollection.RecycleAll Method
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitemversioncollection.recycleall.aspx

QUESTION 115
You have a SharePoint solution that contains a custom site column and a custom content type. You need to add the custom site column as a lookup field for the custom content type. What should you create?

A.    a Feature activation dependency
B.    a new Feature event receiver
C.    a new module
D.    a new SharePoint mapped folder

Answer: B
Explanation:
MNEMONIC RULE: “Feature event receiver”
Walkthrough: Add Feature Event Receivers
http://msdn.microsoft.com/en-us/library/ee231604.aspx

QUESTION 116
You have a SharePoint site collection that has the URL http://contoso/sites/finance. You are creating a Microsoft .NET Framework console application that will use the SharePoint client object model to create a site in the site collection. The application contains the following code segment. (Line numbers are included for reference only.)
01 Dim cCtx As New ClientContext(“http://contoso/sites/finance”)
02 Dim root As Web = cCtx.Site.RootWeb
03 cCtx.Load(root)
04 Dim webInfo As New WebCreationInformation()
05 webInfo.Title = “site1”
06 webInfo.Url = “site1”
07 webInfo.WebTemplate = “MPS#2”
08 root.Webs.Add(webInfo)
09
10 cCtx.Dispose()
You need to ensure that the application creates the site. Which code segment should you add at line 09?

A.    cCtx.ExecuteQuery()
B.    cCtx.Site.RootWeb.Update()
C.    root.Context.Dispose()
D.    root.Update()

Answer: A

QUESTION 117
You need to create a Web Part that adds a term set to the current SharePoint site collection’s term store. You write the following code segment. (Line numbers are included for reference only.)
01 Dim txtBoxTermSetToAdd As New System.Web.UI.WebControls.TextBox()
02 Dim session As New TaxonomySession(SPContext.Current.Site)
03 Dim addedTerm As TermSet = session.TermStores(0).Groups(“MyNewTermStore”).CreateTermSet(txtBoxTermSetToAdd.Text)
04
Which code segment should you add at line 04?

A.    addedTerm.Export()
B.    addedTerm.TermStore.CommitAll()
C.    SPContext.Current.Site.WebApplication.Update()
D.    SPContext.Current.Web.AllowUnsafeUpdates = True

Answer: B

QUESTION 118
You have a SharePoint site collection that contains 100 sites. Each site contains 100 lists. You need to retrieve all item titles from all lists. The data must be retrieved in the minimum amount of time. Which access method should you use?

A.    SPList.Items
B.    SPListltemCollection.GetDataTable
C.    SPSiteDataQuery
D.    ListData.svc

Answer: C
Explanation:
MNEMONIC RULE: “100 sites = SPSite”
The data must be retrieved in the minimum amount of time; therefore, SPSiteDataQuery SPSiteDataQuery Class
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx

QUESTION 119
You have a SharePoint site. The current master page of the site is v4.master. You create a custom master page named MyMasterPage.master and deploy it to /_catalogs/masterpage/. You need to apply the custom master page to the site and ensure that future pages added to the site, including system and application pages, automatically use the custom master page. You must also ensure that future SharePoint updates do not remove or modify the changes you have made. What should you do?

A.    Set the MasterUrl property and CustomMasterUrl property of the site to /_catalogs/masterpage/MyMasterPage.master.
B.    In the Cpage directive of each page layout, set the MasterPageFile attribute to /_catalogs/masterpage/MyMasterPage.master.
C.    Rename the custom master page as v4.master and overwrite \14\TEMPLATE\GL0BAL\v4.master.
D.    Rename the custom master page as v4.master and overwrite /_catalogs/masterpage/v4,master.

Answer: A

QUESTION 120
You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list permissions when users access it by using the web.CurrentUser.DoesUserHavePermissions method. You need to ensure that when users do not have permissions to the list, the Web Part displays the company’s logo. Which code segment should you add to the Web Part?

A.    RunWithElevatedPrivileges;
B.    web.ValldateFormDigest();
C.    web.CurrentUser.RequireRequestToken = false;
D.    web.AllowUnsafeUpdates= true;

Answer: A
Explanation:
MNEMONIC RULE: “DoesUserHavePermissions = RunWithElevatedPrivileges”
You need to elevate your privileges to check on current user’s permissions.
DoesUserHavePermissions?
http://www.shannonbray.com/2010/01/doesuserhavepermissions.html


http://www.passleader.com/70-573.html