nerdexam
Microsoft

70-573 · Question #273

You need to create a Web Part that adds a term set to the current SharePoint site collection's term store. You write the following code segment. (Line numbers are included for reference only.) 01…

The correct answer is B. addedTerm.TermStore.CommitAll(). MNEMONIC RULE: "add a term set = TermStore.CommitAll()"

Developing SharePoint Solutions

Question

You need to create a Web Part that adds a term set to the current SharePoint site collection's term store. You write the following code segment. (Line numbers are included for reference only.) 01 System.Web.UI.WebControls.TextBox txtBoxTermSetToAdd = new System.Web.UI. WebControls.TextBox(); 02 TaxonomySession session = new TaxonomySession(SPContext.Current.Site); 03 TermSet addedTerm = session.TermStores[0].Groups["MyNewTermStore"]. CreateTermSet(txtBoxTermSetToAdd.Text); 04 Which code segment should you add at line 04?

Options

  • AaddedTerm.Export();
  • BaddedTerm.TermStore.CommitAll();
  • CSPContext.Current.Site.WebApplication.Update();
  • DSPContext.Current.Web.AllowUnsafeUpdates = true;

How the community answered

(46 responses)
  • A
    9% (4)
  • B
    72% (33)
  • C
    17% (8)
  • D
    2% (1)

Explanation

MNEMONIC RULE: "add a term set = TermStore.CommitAll()"

Topics

#Taxonomy#term store#CommitAll#TaxonomySession

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice