Try our conversational search powered by Generative AI!

Meridium.FolderBrowserProperty example under MVC




I'm looking for an example of using the Meridium.FolderBrowserProperty NuGet package to implement a folder selection property in an EPiServer 7 MVC site. I've got it installed, but can't get the editing UI to display the popup folder selector. I suspect I'm not registering a UIHint or similar problem.

Can anyone provide an example please?



Feb 25, 2013 0:38

Sure, try with this code:

[UIHint("Folder browser ")]
public virtual string Folder{ get; set; }




Feb 25, 2013 7:57


Thanks, that does register correctly, but there are still a few problems.

1) On the editing screen the control displays a disabled textbox with text "Click the button to edit" and button with text "...", rather than showing the existing value like in the screenshots from epicode. This would be rather annoying for users as they could not see the existing value. Is there some other attribute I should have?

2) When I click the button to get the folder selector popup, and the subsequent button to browse for a folder, this popup is missing all it's styling. This is because the dialog gets 404s for a couple of CSS files. I'd say this missing CSS is causing the dialog save button not to work (using Chrome).

Looking at the code for FolderBrowserDialog.aspx, it's using a path from a variable named ShellPath, which comes from a VPP named EPiServerShell. This VPP did not exist in my config. I've tried to create the VPP as follows, but these CSS resources still result in 404s. Does the config look correct or am I missing something obvious:

    <add virtualPath="~/EPiServerShell" physicalPath="C:\Program Files (x86)\EPiServer\Framework\7.0.859.1\Application\UI"
      name="EPiServerShell" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework" />

I'm wondering if there is some special permissions that blocks files from this location by default?



Edited, Feb 28, 2013 2:56

Andy have you setup a corresponding location element in web.config?


Feb 28, 2013 8:22


No, I'd forgotten to do that. I've now configured the web.config:

  <location path="EPiServerShell">
        <add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer.Framework" />


and VPP in episerverframework.config:

    <add name="EPiServerShell" virtualPath="~/EPiServerShell/" physicalPath="C:\Program Files (x86)\EPiServer\Framework\7.0.859.1\Application\UI" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework" />

also changed the paths in FolderBrowserDialog.aspx so that I don't get 404s any more:

    <link href="<%= ShellPath %>ClientResources/EPi/themes/legacy/Shell.css" type="text/css" rel="stylesheet" />
    <link href="<%= ShellPath %>ClientResources/EPi/themes/legacy/ShellLightTheme.css" type="text/css" rel="stylesheet" />

However the problems still remain. The folder does not show on the main editing screen, and the styling is mostly missing in the select folder dialog.

I also noticed that there are a few JavaScript errors being reported in the select folder tree:

  1. Could not expand path at 3 dojo.js:15
  1. Could not expand path at 3 dojo.js:15
  1. Uncaught TypeError: Object #<HTMLInputElement> has no method 'fireEvent' EditProperty.aspx:104


These will be what is stopping Chrome from processing the Save button. I don't get any JavaScript errors on the main editing screen so not sure why the selected folder doesn't display.z

I think I'll have to stick with a plain text property for now unfortunately as it doesn't look like the folder browser works quite right under v7.

Thanks for your help though!



Mar 01, 2013 0:05

Hi Andy!

The problem is that fireEvent is only compatible with IE. (See: You can use jQuery's trigger to fire the onchange event instead, so you need to change 3 lines of code in ScriptHelper.cs:

Change the lines: 




and of course import jQuery in the beginning of scriptString. :)

It fixes the problem for Chrome and Firefox!


May 27, 2013 14:38

Any chance the version on NuGet could be fixed?

I'd fix myself if I had access to the source code.

Thx, Mike

Jul 10, 2013 16:25

Hi Mike

The source code is up on EPiCode, just register and apply for membership there and you'll have access to it.


Jul 10, 2013 16:29

Hi  Andy ,  have you resolved your problem?

Jul 19, 2013 9:37


I have a problem with the Folder Browser Dialog on WebForms.

I can't get the OnSelectedNodeChanged event to fire at all.

Seems to be some problem with the datasource?


Jan 22, 2014 10:26
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.