I have tried to put an InputDate webcontrol on a page. But I got a javascript error. The onclick event on the InputDate is "EPi.CreateDateBrowserDialog". This javascript method is in "UI/javascript/system.js". But in web config the UI folder only allow roles WebAdmins and WebEditors.

Am I missing something? My idea is that I should be able to use this webcontrol even for anonymous users.

Regards Hans

Jun 12, 2008 6:57

I have solved it but I'm not certain if it is meant to be solved like this

To say before I start: The "SecureUI" folder I write about is the EPiServer UI folder, I named it "SecureUI" at installation.

I had help from the following:

where I found that I have to register the following:
<script type="text/javascript" src="<%= EPiServer.UriSupport.ResolveUrlFromUtilBySettings("javascript/episerverscriptmanager.js") %>"></script>
<script type="text/javascript" src="<%= EPiServer.UriSupport.ResolveUrlFromUIBySettings("javascript/system.js") %>"></script>
<script type="text/javascript" src="<%= EPiServer.UriSupport.ResolveUrlFromUIBySettings("javascript/system.aspx") %>"></script>

I do this in my masterpage.

But if I'm not logged in as admin or editor I get an javascript exception because I dont have access to "SecureUI/javascript/system.aspx".

I have read this before, about Virtual Path Providers and UrlMappings

So I added the following urlmappings in web.config:
    <add url="~/Util/javascript/system.js" mappedUrl="~/SecureUI/javascript/system.js" />
    <add url="~/Util/javascript/system.aspx" mappedUrl="~/SecureUI/javascript/system.aspx" />

And I also changed the following lines in my masterpage, ResolveUrlFromUtilBySettings instead of ResolveUrlFromUIBySettings:
<script type="text/javascript" src="<%= EPiServer.UriSupport.ResolveUrlFromUtilBySettings("javascript/system.js") %>"></script>
<script type="text/javascript" src="<%= EPiServer.UriSupport.ResolveUrlFromUtilBySettings("javascript/system.aspx") %>"></script>

Now it works! But is it meant to be done like this?

Regards Hans

Jun 12, 2008 8:24
That should be fine as far as I know. I did some tests using the InputDate control some time ago, but I just added a new location node to my web.config and grantedfor everyone access to the javascript folder.
Jun 13, 2008 9:47

Thanks Greger!


Jun 16, 2008 11:20
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.