Which code segment should you add at line 04?

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 RunWithElevatedPrivileges(ElevateSub) 02 Private Sub ElevatedSub() 03 Try
04 05 LblVisits.Text = site.Usage.Visits.ToString() 06 Finally 07 … 08 End Try 09 End Sub Which
code segment should you add at line 04?

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 RunWithElevatedPrivileges(ElevateSub) 02 Private Sub ElevatedSub() 03 Try
04 05 LblVisits.Text = site.Usage.Visits.ToString() 06 Finally 07 … 08 End Try 09 End Sub Which
code segment should you add at line 04?

A.
Dim esite As SPSite = SPControl.GetContextSite(HttpContext.Current)

B.
Dim esite As New SPSite(SPContext.Current.Site.ID)

C.
Dim esite As SPSite = SPContext.Current.Site

D.
Dim esite As SPSite = SPContext.GetContext(HttpContext.Current).Site



Leave a Reply 0

Your email address will not be published. Required fields are marked *