管理sharepoint2010开发者面板的4方法
1、stsadm命令行模式
打开模式
stsadm -o setproperty -pn developer-dashboard -pv on
管理模式
stsadm -o setproperty -pn developer-dashboard -pv Off
按需模式
stsadm -o setproperty -pn developer-dashboard -pv ondemand
混合模式
stsadm-o setproperty-pn developer-dashboard-pv expensiveoperationly
2、编码方式
SPWebService content = SPWebService.ContentService; content .DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On; content .DeveloperDashboardSettings.Update();
3、PowerShell脚本
按需模式
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()
打开模式
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$addsetting.Update()
管理模式
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$addsetting.Update()
4、在自定义母板页安装开发仪表板
<Sharepoint:DeveloperDashboardLauncher ID="DeveloperDashboardLauncher" NavigateUrl="javascript:ToggleDeveloperDashboard()" runat="server" ImageUrl="/_layouts/images/fgimg.png" Text="<%$Resources:wss,multipages_launchdevdashalt_text%>" OffsetX=0 OffsetY=222 Height=16 Width=16 />
呈现控件:该呈现控件必须位于页面标记的底部。页面上位于该呈现控件下方的任何控件的度量将不会报告给开发人员面板。