0

I want to integrate elFinder into asp.net mvc 4. I've seen the wiki for elFinder ASP.NET Connector. But I can't understand some of the config.

First of all is the

In Application_Start add Autofac registration:

// register IoC
var builder = new ContainerBuilder();
// add other registrations...
// add elFinder connector registration
builder.RegisterElFinderConnector();
// create container
_container = builder.Build();
// need also to set container in elFinder module
_container.SetAsElFinderResolver();

_container is undefined, should I just create the variable?

IContainer _container;

Where should I put this definition?

I've tried defining the container, and run the project inside visual studio, elFinder said "unable to connect to backend"

and

firebug returned this

enter image description here

4

1 回答 1

0

“无法连接到后端”可能是由于:

  • 您忘记忽略路由,MVC 路由无法解析此路径(因为它不应该这样做)

    routes.IgnoreRoute("elfinder.connector");
    

确保这是在 MapRoute 语句之前指定的。

  • 您的 web.config 中没有定义 HttpHandler

IContainer 是http://api.autofac.org/html/BE4CF761.htm,您可以在构建容器的地方实例化它

// register IoC
var builder = new ContainerBuilder();
// add other registrations...
// add elFinder connector registration
builder.RegisterElFinderConnector();
// create container
IContainer _container = builder.Build();
// need also to set container in elFinder module
_container.SetAsElFinderResolver();
于 2013-02-01T12:12:39.370 回答