Fixing the Personal View in SP 2010 (with Delegate Control)
Please note that the below source code should be applied for SP 2010 without SP1 and June – 2011 CU..
//Fixing the Personal View
string strView = Request.QueryString["ShowWebPart"];
if (!string.IsNullOrEmpty(strView) && control != null)
{
if (SPContext.Current != null)
{
if (SPContext.Current.List != null)
{
SPView spView = SPContext.Current.List.Views[new Guid(strView)];
if (spView.PersonalView)
{
//Fixing the Page Title
try
{
Control pageTitleControl = this.findControl(this.Page, "PlaceHolderPageTitle");
Control currentViewTitleControl = pageTitleControl.Controls[2];
currentViewTitleControl.Visible = false;
pageTitleControl.Controls.Add(new LiteralControl(spView.Title));
}
catch
{
}
//Fixing the Breadcum
try
{
HtmlGenericControl controlDiv = new HtmlGenericControl("span");
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string strScript = @"
";
controlDiv.InnerHtml = strScript;
control.Controls.Add(controlDiv);
}
catch
{
}
}
}
}
}
Comments
Post a Comment