What should you do?
You plan to create two Web Parts named Products and ProductDetails. You create an interface that contains the following code segment.
public interface Interface1
{
string Productid { get; set; }
}
You need to ensure that the Products Web Part sends ProductId to the ProductDetails Web Part. You must achieve this goal by using the ASP.NET Web Part connection framework.
What should you do?
What should you do?
You plan to create two Web Parts named Products and ProductDetails. You create an interface that contains the following code segment.
public interface Interface1
{
string Productid { get; set; }
}
You need to ensure that the Products Web Part sends ProductId to the ProductDetails Web Part. You must achieve this goal by using the ASP.NET Web Part connection framework.
What should you do?
What should you do?
You create a Web Part that contains the following code segment. (Line numbers are included for reference only.)
01 public class WebPart1 : WebPart
02 {
03 public WebPart1() {}
04
05 protected override void CreateChildControls()
06 {
07 Button clickButton = new Button();
08
09 base.CreateChildControls();
10 }
11
12 protected override void RenderContents(HtmlTextWriter writer)
13 {
14
15 base.RenderContents(writer);
16 }
17 }
You discover that the clickButton button does not appear.
You need to ensure that clickButton appears.
What should you do?
Which code segment should you add to the Web Part?
You plan to develop a Web Part that displays a SharePoint list.
The Web Part will verify the list permissions when users access 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?
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.)
01 using (SPSite site=new SPSite(http://intranet))
02 {
03 SPWeb web=site.OpenWeb();
04
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 add at line 04?
You are creating an application.
You develop a custom control that renders a contextual tab. The control contains the following code segment. (Line numbers are included for reference only.)
01 protected override void OnPreRender(EventArgs e)
02 {
03 SPRibbon curRibbon = SPRibbon.GetCurrent(this.Page);
04
05 curRibbon.MakeContextualGroupInitiallyVisible(“SP.Ribbon.ContextualGroup”, string.Empty);
06 base.OnPreRender(e);
07 }
You need to ensure that when the custom control is rendered, the custom contextual tab appears in the Ribbon.
Which code segment should you add at line 04?
Which code segment should you use?
You have a SharePoint farm that has more than 100 custom Features.
You upgrade several Features in the farm.
You need to ensure that the site collection uses the most up-to-date versions of the Features. Only Features that require an upgrade must be evaluated.
Which code segment should you use?
Which code segment should you add to the Web Part?
You create a Feature named Feature1. Feature1 is activated in a SharePoint site.
You create a Web Part that contains the following code.
SPSite site = new SPSite(“http://intranet/site1”);
SPWeb web = site.OpenWeb();
SPFeatureDefinition feature = SPFarm.Local.FeatureDefinitions[“Feature1”];
You need to modify the Web Part to activate Feature1 in Site1 only.
Which code segment should you add to the Web Part?
Which code segment should you use?
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?