Copied to clipboard

Flag this post as spam?

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


  • yogesh pathak 136 posts 221 karma points
    Oct 10, 2015 @ 06:40
    yogesh pathak
    0

    Application_Start is not being hit

    HI All, I need to register my JavaScript bundles in ApplicationStart event of my Umbraco application , but the Applicationstart is not being hit . i have updated my Global.asax as follows

    <%@ Application Codebehind="Global.asax.cs" Inherits="MyProject.Web.MvcApplication" Language="C#" %>

    Any suggestions what i am doing wrong?

    Yogesh

  • Mike Chambers 636 posts 1253 karma points c-trib
    Oct 10, 2015 @ 09:01
  • Pawel Bres 39 posts 160 karma points c-trib
    Oct 10, 2015 @ 16:00
    Pawel Bres
    0

    Hi Yogesh, no need to change Global.asax in this case, just create class inherited from ApplicationEventHandler like in the article suggested by Mike

  • yogesh pathak 136 posts 221 karma points
    Oct 11, 2015 @ 07:23
    yogesh pathak
    0

    thanks for suggestion guys , but its kind of weird behavior , break point at the Application Starting is not being hit every time i start debugging the application

    Yogesh

  • Yasir Butt 162 posts 372 karma points
    Oct 11, 2015 @ 10:45
    Yasir Butt
    0

    Hi

    this will only hit once when application start first time if you refresh the browser so it will not hit again.

    Yasir

  • yogesh pathak 136 posts 221 karma points
    Oct 11, 2015 @ 11:38
    yogesh pathak
    0

    Hi Yasir, I Have placed my register bundle code inside ApplicationStarted method of a class inherited from ApplicationEventHandler , and seems like everything works fine , but earlier i was doing the register bundle or register autofac dependencies in Application_start method of global.asax which is not being hit now. just want to know how this works here cant we use global.asax and ApplicationEventHandler at the same time?

    Yogesh

  • Yasir Butt 162 posts 372 karma points
    Oct 11, 2015 @ 12:03
    Yasir Butt
    0

    Hi,

    Please have a look here

    https://our.umbraco.org/forum/developers/extending-umbraco/52630-Umbraco-7-Globalasax-

    this way you can run your code in Global.asax.cs file

    Yasir

  • Mike Chambers 636 posts 1253 karma points c-trib
    Oct 12, 2015 @ 13:28
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies