I am trying to change the skin of each tabs (filtered) on given portal by using the following code :
pid=484;
DesignController oDesignCtrl = new DesignController();
DesignInfo oDesign = oDesignCtrl.GetDesignDetail(did);
if (oDesign != null)
{
DotNetNuke.Entities.Tabs.TabController oTabCtrl = new DotNetNuke.Entities.Tabs.TabController();
DotNetNuke.Entities.Tabs.TabCollection lstTabs = oTabCtrl.GetTabsByPortal(pid);
System.Collections.ArrayList aryTabs = lstTabs.ToArrayList();
for (int i = 0; i < aryTabs.Count; i++) {
DotNetNuke.Entities.Tabs.TabInfo oTab = (DotNetNuke.Entities.Tabs.TabInfo)aryTabs[i];
if (oTab != null)
{
if (!oTab.IsSuperTab && !oTab.IsDeleted && oTab.Level == 0)
{
oTab.SkinSrc = oDesign.SkinSrc;
oTabCtrl.UpdateTab(oTab);
}}}}
but its throwing following error :
...Default-Advance.doctype.xml' is a physical path, but a virtual path was expected. ---> System.Web.HttpException: 'C:/Inetpub/vhosts/[somefolder]/httpdocs/Portals/_default/Skins/[somefolder]/Default-Advance.doctype.xml' is a physical path, but a virtual path was expected. at System.Web.Util.UrlPath.CheckValidVirtualPath(String path) at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) at System.Web.VirtualPath.Combine(VirtualPath relativePath) at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) at System.Web.HttpServerUtility.MapPath(String path) at DotNetNuke.Entities.Tabs.TabInfo.CheckIfDoctypeConfigExists() at DotNetNuke.Entities.Tabs.TabInfo.get_SkinDoctype() at DotNetNuke.Framework.DefaultPage.SetSkinDoctype() at DotNetNuke.Framework.DefaultPage.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
So, i am not able to write a working code to change a skin for a page programmatically. I am stuck on it and no clue ,nothing on web anywhere , i google too but nothing found.
I really need some suggestion from experts.
Thanks