I have PublishingLayoutPage and depends on query params i should hide few webparts.
But i dont now how to do this. Because if i understand problem correctly SPLimitedWebPartManager will hide webpart for all users!
using (SPLimitedWebPartManager mgr = file.GetLimitedWebPartManager(PersonalizationScope.Shared))
{
try
{
SPLimitedWebPartCollection webparts = mgr.WebParts;
foreach (System.Web.UI.WebControls.WebParts.WebPart wp in webparts)
{
if (wp is MyWebpart && !isShowWebpart)
{
wp.Hidden=true;
mgr.SaveChanges(wp );
}
}
How to hide webpart and doesnot allow to render content only for specific case on page?