Microsoft TS: Office SharePoint Server, Application Development (available in 2010) - 70-573 Exam Practice Test

You need to create a custom content type and specify the content type ID. What should you do?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
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?
Correct Answer: D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a Web Part that contains the following code segment. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e)02 {
03 SPSite site = new SPSite("http://www.contoso.com/default.aspx");
04 {
05 SPWeb web = site.OpenWeb();
06
07 }
08 }
You deploy the Web Part to a SharePoint site.
After you deploy the Web Part, users report that the site loads slowly. You need to modify the Web Part to prevent the site from loading slowly.
What should you do?
Correct Answer: B
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You need to add a modal dialog box to a SharePoint application. What should you use?
Correct Answer: D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a SharePoint site that has the URL http://contoso.com/hr.
You are creating a new Web Part.
You need to create a reference to the current subsite without having to dispose of any returned objects.
Which code segment should you use?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a custom Web Part.
You need to create a custom user interface for modifying the Web Part properties.
What should you do?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
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?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You create a custom page layout that contains code-behind.
You need to identify whether the page is in Edit mode or in Display mode.
What should you use?
Correct Answer: C
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
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?
Correct Answer: C
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You create a Feature.
You need to remove the link to the Site Content Type page from the Site Settings page by using the Feature.
Which element should you use in the Feature?
Correct Answer: B
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).