Mono Support I need to to change global.asax's Application_Start method in MonoX , could it be possible? 

Viewed 22935 time(s), 3 post(s), 11/26/2015 10:22:31 AM - by inanc
11/26/2015 10:22:31 AM
469 Reputation 60 Total posts

I need to to change global.asax's   'Application_Start'  method in MonoX  for MVC integration , could it be possible?

I would like to have sometihng like given below;

    public class Global : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
            routes.MapRoute(
               "Default",
// Route name
               "{controller}/{action}/{id}",
// URL with parameters
               new { controller = "Home", action = "Index", id = "" }
// Parameter defaults
                );
        }
        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);
        }
    }


I've already deleted precompiled.config. Actually there were no file in my zipped install package..
Can someone help me a little bit please? Thanks

1
11/26/2015 10:30:55 AM
3016 Reputation 428 Total posts

Hi,

you can extend the MonoX's Global.asax, override Application_Start method and call your RegisterRoutes methode there, after the base method call.

Regards.

2
11/26/2015 11:37:45 AM
469 Reputation 60 Total posts

Hi Imarusic,
Thank you for your answer. It is ok now..kind regards..
Inanc

3
This is a demo site for MonoX. Please visit Mono Software for more info.