PrepAway - Latest Free Exam Questions & Answers

Category: 70-573

Exam 70-573: TS: Microsoft SharePoint 2010, Application Development

Which code segment should you add at line 03?

You have a SharePoint site collection that contains 100 subsites.

You plan to create a Web Part. The Web Part will be deployed to each subsite.

You need to ensure that the Web Part retrieves all of the files in the root directory of the current subsite.

You write the following code segment. (Line numbers are included for reference only.)

01 SPSite site = SPContext.Current.Site;
02 SPWeb web = SPContext.Current.Web;
03

Which code segment should you add at line 03?

What should you do?

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?


Page 13 of 18« First...1112131415...Last »