Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Global.asax - Code Behind or Inline? (http://www.velocityreviews.com/forums/t88579-global-asax-code-behind-or-inline.html)

Jon Maz 10-13-2004 10:53 AM

Global.asax - Code Behind or Inline?
 
Hi All,

I've just noticed that there seem to be two ways of setting up a global.asax
file.

At http://www.csharphelp.com/archives/archive206.html the global.asax
example has Application_Start etc within <script runat="server"> ...
</script> tags, whereas VS.Net creates a global.asax.cs file that is
presumably pre-compiled like a .aspx.cs file.

Am I correct in assuming that global.asax works just like a .aspx, ie there
is a Code Behind model and an Inline model, and the programmer has an open
choice between the two, depending on a trade-off between speed (compiled
Code Behind) versus the maintainability of not having to recompile after
changes (Inline)?

And presumably, as with inline .aspx pages, does an inline global.asax get
compiled when the first page of the application is hit?

TIA,

JON




=?Utf-8?B?QW5zaWwgTUNBRA==?= 10-13-2004 12:29 PM

RE: Global.asax - Code Behind or Inline?
 
hi ,
yes you are right global.asax can be both inline and codebehind .

regards
ansil

"Jon Maz" wrote:

> Hi All,
>
> I've just noticed that there seem to be two ways of setting up a global.asax
> file.
>
> At http://www.csharphelp.com/archives/archive206.html the global.asax
> example has Application_Start etc within <script runat="server"> ...
> </script> tags, whereas VS.Net creates a global.asax.cs file that is
> presumably pre-compiled like a .aspx.cs file.
>
> Am I correct in assuming that global.asax works just like a .aspx, ie there
> is a Code Behind model and an Inline model, and the programmer has an open
> choice between the two, depending on a trade-off between speed (compiled
> Code Behind) versus the maintainability of not having to recompile after
> changes (Inline)?
>
> And presumably, as with inline .aspx pages, does an inline global.asax get
> compiled when the first page of the application is hit?
>
> TIA,
>
> JON
>
>
>
>


Jon Maz 10-13-2004 01:17 PM

Re: Global.asax - Code Behind or Inline?
 
With advantages / disadavantages exactly as with Code Behind / Inline for an
..aspx?

J



Scott Allen 10-13-2004 02:39 PM

Re: Global.asax - Code Behind or Inline?
 
Yes, same advantages disadvantages. The runtime will compile
global.asax with inline code when the application spins up. At that
point, there really is no runtime performance diff of the code in
global.asax versus code compiled in the code behind.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 13 Oct 2004 14:17:00 +0100, "Jon Maz" <jonmaz@surfeuNOSPAM.de>
wrote:

>With advantages / disadavantages exactly as with Code Behind / Inline for an
>.aspx?
>
>J
>




All times are GMT. The time now is 10:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57