I'm trying to implement the pattern that's introduced by this question
The accepted answer provides a strategy where routes have been defined in a separate class. The question I have is exactly how to call that code from Global.asax.
thx
I'm trying to implement the pattern that's introduced by this question
The accepted answer provides a strategy where routes have been defined in a separate class. The question I have is exactly how to call that code from Global.asax.
thx
See another answer from the same question, or more specifically the link provided in that answer.
All that you should have to do is add an instance of
ExampleRoute
to theRouteCollection
in the global.asax.Let me show you how can you register route which is specified anywhere in the project as long as the dll file containing lies in the bin folder.
define an interface
Now say you want to register some route some where far in the jungle. Create a class and inherit it from the above given interface.
Now how to call this route from global.asax file. Load all the types which are inherited from IRegiserRoute (from How to find all the classes which implement a given interface?)
//Now register all your routes anywhere in bin folder.
I hope this should get you going.
cheers
Parminder