Microsoft
70-573 · Question #279
70-573 Question #279: Real Exam Question with Answer & Explanation
Sign in or unlock 70-573 to reveal the answer and full explanation for question #279. The question stem and answer options stay visible for context.
Question
You create a Web Part. You need to display the number of visits to a SharePoint site collection in a label named LblVisits. You write the following code segment. (Line numbers are included for reference only.) 01 SPSecurity.RunWithElevatedPrivileges(delegate() 02 { 03 try 04 { 05 06 LblVisits.Text = site.Usage.Visits.ToString(); 07 } 08 finally 09 { 10 11 } 12 }); Which code segment should you add at line 05?
Options
- ASPSite site = new SPSite(SPContext.Current.Site.ID);
- BSPSite site = SPContext.Current.Site;
- CSPSite site = SPContext.GetContext(HttpContext.Current).Site;
- DSPSite site = SPControl.GetContextSite(HttpContext.Current);
Unlock 70-573 to see the answer
You've previewed enough free 70-573 questions. Unlock 70-573 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.