You are running a default installation of Microsoft Visual Studio 2010. You have a user control named Control.ascx.
You need to convert the user control to a Web Part that will be hosted in a Microsoft SharePoint Server 2010 farm. The Web Part must be packaged as a sandboxed solution.
What should you do?
A. Create a new Web Part and reuse the code from the existing MyControl.ascx file.You create a Web Part that takes three values from three text boxes and creates a new SharePoint site when you click a button named CreateNewSite.
The Web Part contains the following code segment.
protected void CreateNewSite_Click(object sender, EventArgs e)
{
SPSite site = SPContext.Current.Site;
SPWeb web = site.AllWebs.Add(SiteNameTextBox.Text, SiteTitleTextBox.Text,
SiteDescriptionTextBox.Text, 0, SPWebTemplate.WebTemplateSTS, false, false);
}
You test the Web Part and it works properly.
When another user attempts to use the Web Part to create a new site, he receives the following error message: "Error: Access Denied."
You need to ensure that users can use the Web Part to create new sites.
What should you do?
A. Add web.Update() after the code segment.You need to create a Web Part that displays all social tags entered by users. Which code segment should you use?
A. TaxonomySession session = new TaxonomySession(SPContext.Current.Site); TermSet socialTags = session.DefaultKeywordsTermStore.SystemGroup.TermSets ["Keywords"];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 TaxonomySession session = new TaxonomySession ( SPContext.Current..Site ) ;
02 TermSet addedTerm = session.TermStores [O] .Groups
[" MyNewTermStore "] . CreateTermSet ( txtBoxTermSetToAdd.Text ) ; Which code segment should you add at line 03?
A. addedTerm.TermStore.CommitAll ();You need to create a Web Part that displays all of the permission levels of the current subsite. Which collection should you use?
A. SPContext.Current.Web.PermissionsYou create a custom page layout that has a field control named Field1.
You need to ensure that Field1 is only visible when users modify the contents of the page.
Which parent control should you use for Field1?
A. PublishingContextYou have a helper method named CreateSiteColumn that contains the following code segment.
Private Shared Sub CreateSiteColumn
(ByVal web As SPWeb, ByVal columnName As String)
web.Lists(0).Views(0).ViewFields.Add(columnName)
End Sub
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. Dim field As SPField = New SPFieldChoice (web.Lists(0).Fields, columnName)You create a custom site definition named DCS. You create a site provision handler for DCS. DCS contains a file named DCSTemplate.xsd that stores configuration data. You need to read the content of DCSTemplate.xsd in the site provision handler. Which property should you use?
A. SPSite.GetCustomWebTemplates(1033)["DCS"].ProvisionClassYou need to create a custom Web Part that meets the following requirements:
稩ncludes all of the functionalities of the Search Results Web Part
稩ncludes additional filters based on the current user department What should you do?
A. Create a Web Part that inherits the CoreResultsWebPart class.You have a Microsoft .NET Framework console application that uses the SharePoint client object model. The application contains the following code segment. (Line numbers are included for reference only.)
01 Dim cCtx As ClientContext = New ClientContext("http://contoso/sites/finance")
02 Dim root As Web = cCtx.Site.RootWeb
03 cCtx.Load(root)
04 Dim webInfo As WebCreationInformation = New WebCreationInformation
05 webInfo.Title = "site1"
06 webInfo.Url = "site1"
07 webInfo.WebTemplate = "MPS#2"
08 root.Webs.Add(webInfo) 10 cCtx.Dispose
You need to ensure that the application queries Shared Documents for a document named Doc1.docx. Which code element should you add at line 09?
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 70-573 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.