PrepAway - Latest Free Exam Questions & Answers

Category: 70-573 (v.1)

Exam 70-573: TS: Microsoft SharePoint 2010, Application Development (update October 30th, 2015)

Which code segments should you add at lines 03, 04, 05, and 06?

You are creating an event receiver. The event receiver will have a field named Title and a field
named Priority. You write the following code segment for the event receiver. (Line numbers are
included for reference only.) 01 public override void ItemUpdating(SPItemEventProperties prop)
02 { 02 base.ItemUpdating(prop); 03 04 05 06 07 } You need to ensure that when the Title field is
changed to include the word IMPORTANT, the Priority field is set to URGENT. Which code
segments should you add at lines 03, 04, 05, and 06?

Which code segment should you add at line 05?

You have a SharePoint list named Announcements. You have an event receiver that contains the
following code segment. (Line numbers are included for reference only.) 01 public override void
ItemAdding(SPItemEventProperties properties) 02 { 03 if
(properties.ListItem[“Title”].ToString().Contains(“secret”)) 04 { 05 06 } 07 } You need to prevent
users from adding items that contain the word “secret” in the title to the list. Which code segment
should you add at line 05?

Which code segment should you add at line 05?

You need to programmatically add a user named User1 to a group named Group1. You write the
following code segment. (Line numbers are included for reference only.) 01 string login = “User1”;
02 string grpName = “Group1”; 03 SPUser user = SPContext.Current.Web.EnsureUser(login); 04
SPGroup group = SPContext.Current.Web.Groups[grpName]; 05 06 group.Update(); Which code
segment should you add at line 05?

You need to ensure that GridView1 only displays items from Announcements that have an expiry date that is grea

You create a Web Part. The Web Part contains a grid view named GridView1 and the following
code segment. (Line numbers are included for reference only.) 01 IntranetDataContext dc = new
IntranetDataContext(“http://intranet”); 02 MyGridView.DataSource = from announce In
dc.Announcements _ ; 03 04 Select announce IntranetDataContext is a LINQ context. You need
to ensure that GridView1 only displays items from Announcements that have an expiry date that is
greater than or equal to the current date. What should you do?

You need to ensure that the .NET application displays the title of the SharePoint Web application in textBoxTi

You have a SharePoint Web application that has the URL http://intranet. You are creating a
Microsoft .NET Framework application that will display the title of the SharePoint Web application
and will execute outside of the SharePoint server. You create a textbox named textBoxTitle. You
write the following code segment. (Line numbers are included for reference only.) 01
ClientContext context = new ClientContext(“http://intranet”); 02 03 Web site = context.Web; 04
context.Load(site); 05 06 textBoxTitle.Text = site.Title; You discover that line 04 generates an
error. You need to ensure that the .NET application displays the title of the SharePoint Web
application in textBoxTitle. What should you do?

Which code element should you add at line 09?

You have a Microsoft .NET Framework console application that uses the SharePoint client object
model. The application contains the following code segment. (Line numbers are included for
reference only.) 01 ClientContext cCtx = new ClientContext(“http://intranet/hr”); 02 List
sharedDocList = cCtx.Web.Lists.GetByTitle(“Shared Documents”); 03 CamlQuery camlQuery =
new CamlQuery(); 04 camlQuery.ViewXml = 05 @”<View> 06 <Query> 07 <Where> 08 <Eq> 09
10 <Value Type=’Text’>Doc1.docx</Value> 11 </Eq> 12 </Where> 13 </Query> 14 </View>”; 15
ListItemCollection docLibItems = sharedDocList.GetItems(camlQuery); 16
cCtx.Load(sharedDocList); 17 cCtx.Load(docLibItems); 18 cCtx.ExecuteQuery(); You need to
ensure that the application queries Shared Documents for a document named Doc1.docx. Which
code element should you add at line 09?

Which code segment should you add at line 04?

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?

Which code segment should you add at line 04?

You need to create a Web Part that displays all of the content created by a specific user. You
write the following code segment. (Line numbers are included for reference only.) 01 private void
keywordQueryExecute(string searchAuthor) 02 { 03 KeywordQuery kRequest = new
KeywordQuery(ServerContext.Current); 04 05 kRequest.QueryText = strQuery; 06

ResultTableCollection resultTbls = kRequest.Execute(); 07 } Which code segment should you add
at line 04?

Which code segment should you add at line 03?

You need to create a Web Part that displays all of the content created by a specific user. You
write the following code segment. (Line numbers are included for reference only.) 01
FullTextSqlQuery qry = new FullTextSqlQuery(ServerContext.GetContext(SPContext.
Current.Site)); 02 qry.ResultTypes = ResultType.RelevantResults; 03 04 qry.QueryText =
strQuery; 05 ResultTableCollection results = qry.Execute(); Which code segment should you add
at line 03?


Page 23 of 24« First...10...2021222324