PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
SPRibbon.GetCurrent(this.Page).CommandUIVisible = false;

B.
SPRibbon.GetCurrent(this.Page).Dispose();

C.
this.Page.FindControl(“SPRibbon”).Dispose();

D.
this.Page.FindControl(“SPRibbon”).Visible = false;

Explanation:
MNEMONIC RULE: “CommandUIVisible”

There are two parts to the ribbon: the upper part, where other controls such as site actions can be put, and the CommandUI part that has the buttons and controls. This property controls the lower part of the ribbon. So, if this property is set to false, the site actions still appear in the upper part of the ribbon, but no tabs and buttons appear in the lower part.

Ribbon.CommandUIVisible Property
http://msdn.microsoft.com/en-us/library/microsoft.web.commandui.ribbon.commanduivisible.aspx


Leave a Reply