MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

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

22420 put(a) pogledan, 3 odgovor(a) 26.11.2015. 10:22:31Kreirao(la) inanc
inanc

inanc

26.11.2015. 10:22:31
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
Ovaj sadržaj još nije ocijenjen. 
469 Reputacija 60 Ukupno objava
imarusic

imarusic

26.11.2015. 10:30:55
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.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
inanc

inanc

26.11.2015. 11:37:45
Hi Imarusic,
Thank you for your answer. It is ok now..kind regards..
Inanc
Ovaj sadržaj još nije ocijenjen. 
469 Reputacija 60 Ukupno objava