Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Global.asax - Code Behind or Inline?

Reply
Thread Tools

Global.asax - Code Behind or Inline?

 
 
Jon Maz
Guest
Posts: n/a
 
      10-13-2004
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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5zaWwgTUNBRA==?=
Guest
Posts: n/a
 
      10-13-2004
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
>
>
>
>

 
Reply With Quote
 
 
 
 
Jon Maz
Guest
Posts: n/a
 
      10-13-2004
With advantages / disadavantages exactly as with Code Behind / Inline for an
..aspx?

J


 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      10-13-2004
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" <(E-Mail Removed)>
wrote:

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-code behind to code behind John ASP .Net 2 02-19-2007 07:08 PM
what is the difference between code inside a <script> tag and code in the code-behind file? keithb ASP .Net 1 03-29-2006 01:00 AM
Code-Behind Pain in the Behind! Daniel Manes ASP .Net 11 06-10-2005 09:47 PM
Fire Code behind code AND Javascript code associated to a Button Click Event =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?= ASP .Net 4 02-11-2004 07:31 AM
Re: Code Behind vs. no code behind: error Ben Miller [msft] ASP .Net 1 06-28-2003 01:46 AM



Advertisments