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?
Which code segment should you add to the console application?
You have a custom theme named MyTheme . The theme is defined in a file named
MyTheme.thmx . You have a console application that contains the following code segment. (Line
numbers are included for reference only.) 101 using ( SPSite sice = new SPSite ( “http://intranet”
}} 02 { 03 SPWeb web – site.OpenWeb (); 01 05 } You need to programmatically apply the theme
to a SharePoint site. Which code segment should you add to the console application?
Which code segment should you include in the Web Part?
You need to create a Web Part that hides the out-of-the-box Ribbon on the current page. Which
code segment should you include in the Web Part?
Which code segment should you use?
You create a modal dialog that displays a list of items. You need to capture the items selected by
a user. Which code segment should you use?
Which file should you modify?
You create a custom site definition. You need to modify the contents of the Quick Launch area.
Which file should you modify?
You need to hide the Quick Launch navigation bar of a SharePoint site
You create a Feature receiver. You need to hide the Quick Launch navigation bar of a SharePoint
site. What should you use?
You need to ensure that the code opens the dialog box
You are creating an application page that will open a dialog box. The application page uses a
custom master page. You write the following code segment. (Line numbers are included for
reference only.) 01 < script type=”text/javascript” > 02 function DialogCallback ( dialogResult,
retumValue ){> 03 function OpenEditDialog (id){ 04 var options = { url:” http://intranet/Jayouts
/MsgToShow.aspx, width: 300, 05 height: 300, 06 dialogReturnValueCallback : DialogCallback 07
}; 08 SP.UI.ModalDialog.showModalDialog (options); 09 } 10 < /script > You need to ensure that
the code opens the dialog box. What should you do?
Which control should you include in Form1?
You created a custom ASPX page that updates a list. The page is deployed to the Jayouts folder.
The page contains the following code segment. 01 < form id=” Forml” runat =” Server” > 02 < asp:
Button id=” btnUpdate ” runat =” server” Text=” Update” ></asp : Button > 03 </form > A user
attempts to update the list by using the p age and receives the following error message: “The
security validation for this page is invalid”. You need to prevent the error from occurring. Which
control should you include in Form1?
Which property should you use?
You have a Microsoft Office SharePoint Server 2007 site. You upgrade the site to SharePoint
Server 2010. You need to create a Feature that prevents site collection administrators from
upgrading the user interface of the site to SharePoint Server 2010. Which property should you
use?
You need to ensure that the application activates the Developer Dashboard
You plan to activate the Developer Dashboard. You create a command line application that
contains the following code segment. (Line numbers are included for reference only.) 01
SPUebService cs = SPHebService.ContentServi.ee ; 02
cs.DeveloperDashfooardSettings.DisplayLevel = SPDeveloperDashboardLevel.On ; 03 You
execute the application and discover that the Developer Dashboard fails to appear. You need to
ensure that the application activates the Developer Dashboard. What should you do?