Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Víctor Manuel 10 posts 31 karma points
    Sep 14, 2010 @ 11:26
    Víctor Manuel
    0

    Using my own global.asax file

    Hi all,

    First of all, sorry for my english, I'm not so good writing.

    I'm trying to migrate an existing web into umbraco. This web has his own global.asax file which make some actions in Application_Start, Application_End, Session_Start and Application_BeginRequest events.

    I've read several posts about this topic:

    http://our.umbraco.org/forum/developers/extending-umbraco/4752-Extending-Globalasax

    http://our.umbraco.org/forum/developers/extending-umbraco/10564-Accessing-globalasax-events-

    http://our.umbraco.org/forum/developers/extending-umbraco/6100-How-to-create-globalasax-file-in-umbraco

    and so on....

    I've proved the solutions, but any has solved my problem :(

    Can anyone give me another solution?

    Thanks, and sorry for my english again.

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 14, 2010 @ 14:59
    Ismail Mayat
    0

    Victor,

    I have used the replacing global_asx.dll method and Matt brailsford better method of using applicationbase both work.  Can you paste some code of your solution that doesnt work also what version of umbraco are you using?

    Regards

    Ismail

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Sep 14, 2010 @ 16:52
    Aaron Powell
    0

    You could always turn your "global.asax" implementation into a HttpModule and just attach to the events that way.

    Personally I prefer the HttpModule to using global.asax, I don't like that you can only have one, and that it used magic names for methods to attach handlers. To me it is just a nasty hold over from classic ASP :P

  • Víctor Manuel 10 posts 31 karma points
    Sep 14, 2010 @ 17:56
    Víctor Manuel
    0

    Ismail,

    My umbraco version is 4.0.3, I don't know what do mean with "replacing global_asx.dll". (I think that the problem is my english, I'm spanish)

    What I've done exactly has been:

    One solution: delete App_global.asax.dll from /bin, create my own global.asax file (Add->new element->Global Application Class) and insert my old code, compile and copy .bin and .ascx files into the correct folders. In this solution I suspect I have to do something else, but I don't know what...

    Other solution: similar to Matt's solutions. delete app_global.asax.dll file, create a .cs file and declare a class that inherits from umbraco.global and then acts similar like "One solution" but whitout success

    I enclose the code that I have to execute in Application_Start event:

                Application["strConn"] = ConfigurationManager.AppSettings["connstring"];
                //WebMapas
                Application["urlWebMapa"] = ConfigurationManager.AppSettings["urlWebMapa"];        

               <<<<<<<<<<<<<<        more         >>>>>>>>>>>
                Application["passPalviewgsp"] = ConfigurationManager.AppSettings["passPalviewgsp"];

                //Url de la aplicacion
                Application["urlBase"] = ConfigurationManager.AppSettings["urlBase"];

                try
                {


                    //---------------------------------------------------------------------//                  
                    AppDomain.CurrentDomain.AppendPrivatePath(Application["rutaInformesExternos"] + "\\bin");
                    CAccesoDllExternas cdllExt = new CAccesoDllExternas();
                    cdllExt.ObtenerObjetosInformesExternos();
                    //---------------------------------------------------------------------//

                    Assembly ass = Assembly.Load("recursosRideSharing");
                    RecursosMng = new ResourceManager("recursosRideSharing", ass);

                    Assembly assEx = Assembly.Load("recursosInforme");
                    RecursosMngEx = new ResourceManager("recursosInforme", assEx);

     

    Slace,

    I have not probe HttpModule yet, but I've read in a post that events like Session_Start, Session_End, Application_BeginRequest and so on.. can't be catched

     

    thank you very much

     

    Víctor Manuel

     

     

  • Víctor Manuel 10 posts 31 karma points
    Sep 17, 2010 @ 12:29
    Víctor Manuel
    0

    Hi again!

    I just solve my problem!!!

    I've simply created a global.asax file whith my own code and I've copied the global.asax and global.asax.cs files in wwwroot folder. Now I can hung Application_Start, Application_End, Session_Start and Application_BeginRequest... events.

    ah, and I've deleted the App_global.asax.dll in the bin folder too.

    Many thanks.

    Víctor M.

Please Sign in or register to post replies

Write your reply to:

Draft