global.asax or global.ascx?

Discussion in 'ASP .Net' started by Daves, Mar 15, 2005.

  1. Daves

    Daves Guest

    emm... what exactly is the difference?!
    If I want a global file without <script></script> tags could I use
    global.ascx only like

    class Global
    {
    void Session_Start(Object sender, EventArgs e)
    {...}
    }
    Daves, Mar 15, 2005
    #1
    1. Advertising

  2. Daves

    Scott M. Guest

    ..ascx denotes a User Control and this file is not automatically looked at
    the moment your application starts or ends or when a session begins or ends.
    ..asax denotes the Global Application File and this file is automatically
    checked for event handlers during several different events by IIS.


    "Daves" <> wrote in message
    news:ek%23h%...
    > emm... what exactly is the difference?!
    > If I want a global file without <script></script> tags could I use
    > global.ascx only like
    >
    > class Global
    > {
    > void Session_Start(Object sender, EventArgs e)
    > {...}
    > }
    >
    Scott M., Mar 15, 2005
    #2
    1. Advertising

  3. global.asax.vb is the file that actually contains application and session
    event handlers. You can see this file from VS.IDE by clicking the "Show All
    Files" icon in the upper section of the Solution Explorer


    "Daves" wrote:

    > emm... what exactly is the difference?!
    > If I want a global file without <script></script> tags could I use
    > global.ascx only like
    >
    > class Global
    > {
    > void Session_Start(Object sender, EventArgs e)
    > {...}
    > }
    >
    >
    >
    =?Utf-8?B?QWxpZW4yXzUx?=, Mar 15, 2005
    #3
  4. Daves

    Scott M. Guest

    In VB.NET, you don't need to "un-hide" the file in the Solution Explorer, it
    is a part of the project and is shown all the time. I suspect this is the
    case in C# as well.


    "Alien2_51" <> wrote in message
    news:...
    > global.asax.vb is the file that actually contains application and session
    > event handlers. You can see this file from VS.IDE by clicking the "Show
    > All
    > Files" icon in the upper section of the Solution Explorer
    >
    >
    > "Daves" wrote:
    >
    >> emm... what exactly is the difference?!
    >> If I want a global file without <script></script> tags could I use
    >> global.ascx only like
    >>
    >> class Global
    >> {
    >> void Session_Start(Object sender, EventArgs e)
    >> {...}
    >> }
    >>
    >>
    >>
    Scott M., Mar 16, 2005
    #4
  5. The "Show All Files" toggles whether or not you can see files in the project
    directory which are not part of the project and adds the "+" and "-" controls
    to the project files in the solution explorer so you can see the code behind
    and resource files...


    "Scott M." wrote:

    > In VB.NET, you don't need to "un-hide" the file in the Solution Explorer, it
    > is a part of the project and is shown all the time. I suspect this is the
    > case in C# as well.
    >
    >
    > "Alien2_51" <> wrote in message
    > news:...
    > > global.asax.vb is the file that actually contains application and session
    > > event handlers. You can see this file from VS.IDE by clicking the "Show
    > > All
    > > Files" icon in the upper section of the Solution Explorer
    > >
    > >
    > > "Daves" wrote:
    > >
    > >> emm... what exactly is the difference?!
    > >> If I want a global file without <script></script> tags could I use
    > >> global.ascx only like
    > >>
    > >> class Global
    > >> {
    > >> void Session_Start(Object sender, EventArgs e)
    > >> {...}
    > >> }
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?QWxpZW4yXzUx?=, Mar 16, 2005
    #5
  6. Daves

    Scott M. Guest

    Yes, I know that. But, Global.asax is considered part of the project and is
    shown by default without having to "un-hide" it.


    "Alien2_51" <> wrote in message
    news:D...
    > The "Show All Files" toggles whether or not you can see files in the
    > project
    > directory which are not part of the project and adds the "+" and "-"
    > controls
    > to the project files in the solution explorer so you can see the code
    > behind
    > and resource files...
    >
    >
    > "Scott M." wrote:
    >
    >> In VB.NET, you don't need to "un-hide" the file in the Solution Explorer,
    >> it
    >> is a part of the project and is shown all the time. I suspect this is
    >> the
    >> case in C# as well.
    >>
    >>
    >> "Alien2_51" <> wrote in message
    >> news:...
    >> > global.asax.vb is the file that actually contains application and
    >> > session
    >> > event handlers. You can see this file from VS.IDE by clicking the "Show
    >> > All
    >> > Files" icon in the upper section of the Solution Explorer
    >> >
    >> >
    >> > "Daves" wrote:
    >> >
    >> >> emm... what exactly is the difference?!
    >> >> If I want a global file without <script></script> tags could I use
    >> >> global.ascx only like
    >> >>
    >> >> class Global
    >> >> {
    >> >> void Session_Start(Object sender, EventArgs e)
    >> >> {...}
    >> >> }
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Scott M., Mar 16, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin
    Replies:
    1
    Views:
    487
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    482
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,942
    Holger (David) Wagner
    Jul 3, 2004
  4. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    827
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  5. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,155
    Mark Rae
    May 23, 2006
Loading...

Share This Page