Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

episerverscriptmanager.js

Vote:
 

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?

#23309
Sep 03, 2008 9:26
Vote:
 

I'm also interested in getting rid of this script..

Anyone?

#25480
Oct 28, 2008 9:13
Vote:
 

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

#25484
Oct 28, 2008 9:33
Vote:
 

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.

#25494
Oct 28, 2008 11:07
Vote:
 

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

 

#25502
Oct 28, 2008 14:00
Vote:
 

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.. 

 

#25523
Edited, Oct 29, 2008 8:05
Vote:
 

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

#25524
Oct 29, 2008 8:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.