Hi Christer
Could you post the code you're using to create the page on the other site?
Frederik
Here it comes:
int fullProjectPageID = //ID of existing page;
PageReference MobileStartPage = //Root node of second site;
PageData projectStartPage = DataFactory.Instance.GetPage(new PageReference(fullProjectPageID));
PageData generatedPage = DataFactory.Instance.GetDefaultPageData(MobileStartPage, MobileProjectPageType.PageTypeID);
generatedPage.PageName = DataFactory.Instance.GetPage(projectStartPage.ParentLink).PageName;
generatedPage["FullProjectPage"] = projectStartPage.PageLink;
generatedPage["PageHeading"] = projectStartPage["PageHeading"];
//etc for all properties
foreach (PageData sibling in DataFactory.Instance.GetChildren(projectStartPage.ParentLink))
{
if (sibling.PageName.Equals("Bilder"))
{
generatedPage["ImageAlbum"] = sibling["ProjectImageAlbum"];
break;
}
}
DataFactory.Instance.Save(generatedPage, EPiServer.DataAccess.SaveAction.Publish);
/* I've tried adding DataFactoryCache.RemovePage(MobileStartPage) here but the result is the same */
Do you use more than one front web server in this setup? Are you serving the mobile web site from a different front web server perhaps? In that case it's probably the cache synchronization between servers that isn't working.
We do have a load balanced environment yes, but in this case I'm still on my development machine running a local IIS instance in Windows Vista.
They use the same AppPool yes, and they are both visible in the same EPiServer UI. However, I cannot log in to the second site in IE due to an exception: "This request has probably been tampered with. Close the browser and try again." In Google Chrome it works. Perhaps this has something to do with it?
The same App pool is one thing, but are they the same app = site in IIS? I'm thinking you have two apps pointing to the same directory? In that case they won't share memory and they will have to be cache-synchronized in the same way as load-balanced applications (as they "share" content).
That must be it! I've deleted the second site in IIS and just added it as a binding to the first. However, this produces the error message Application is initialized with settings for siteId="X", but current request maps to siteId="Y". I guess I have to set up remote events on my developer machine and use two apps in IIS. Thanks for the help!!
Hi! I have two sites in the same EPiServer instance. I'm writing an admin plugin that takes some properties from a page on the first site and creates a page on the second from that information (a mobile version of the first page). The problem is that the newly created page is not visible in the second site until I recompile everything, which makes me think that it is a caching issue. If I run the admin plugin from the second site the change is reflected immediately. I've tried to remove the start page on the second site from cache by calling DataFactoryCache.RemovePage when creating the page but to no success. Does anyone know how to make the second site refresh if I run the plugin from the first site? Cheers!