November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi!
http://world.episerver.com/Forum/Pages/Thread.aspx?id=15884&epslanguage=en
If you read this post I hope it will explain some of the things going on with episerverscriptmanager.js. At least if you have below code almost at the end of page. If you don't I am really interested to hear about it. I make some suggestions to solve the problems in the post above, but forgot to mention turning On page edit off, which should solve the problem as well.
EPi.RegisterPropertyObject(window, "EPiObject", {EPiOnPageEditControl:"OnPageEditControl"});
/Regards
Henrik
Henrik,
thanks for your good explanations!
I have created a new aspx from Visual Studio (containing the standard crap, basically it's empty), and the code behind extends TemplatePage. I have not added any episerver controls to the page (and I have not included the snippet you mentioned above).
The script still shows up (this means that it is loaded from the Episerver dlls). This is normally not an issue, but we are creating a mobile portal - and we want to keep the load as low as possible.
Have you tried to inherit from SimplePage? I have no idea if it helps the problem (not tested) but I think it would prevent the problems with EPiServerScriptManager.js and it should be better performance wise.
The TemplatePage constructors also allows you to disable ContextMenu. This is done by calling the TemplatePage constructor from your page constructor.
PageConstructor() : base(0, EPiServer.Web.PageExtensions.ContextMenu.OptionFlag)
/Regards
Henrik
Thanks for your help, Henrik!
I need the context menu to be available if the user is logged in. Adding the following did it:
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
ContextMenu.IsMenuEnabled = false;
}
}
I still think it's strange that I need to add this code to avoid loading the script..
I see...
In that case you'll also have to prevent the script registering of "EPi.SetupPropertyObjects" in bottom of the page, otherwise you will get a script error.
But that is perhaps the only solution until we have a fix for the problem. And no, I don't know when a fix will be available ;)...
/Sorry
Henrik
On EPiServer pages, the tag <script src="/Util/javascript/episerverscriptmanager.js" type="text/javascript"></script> seems to be added to the output code, even for public pages when user is not logged in.
Is there an easy way of getting rid of it?