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 )

Viewed 8066 time(s), 3 post(s) 11/26/2015 10:22:31 AMby inanc
inanc

inanc

11/26/2015 10:22:31 AM
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
This content has not been rated yet. 
469 Reputation 60 Total posts
imarusic

imarusic

11/26/2015 10:30:55 AM
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.
This content has not been rated yet. 
3016 Reputation 428 Total posts
inanc

inanc

11/26/2015 11:37:45 AM
Hi Imarusic,
Thank you for your answer. It is ok now..kind regards..
Inanc
This content has not been rated yet. 
469 Reputation 60 Total posts