Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2003, 08:12 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default transfearing code to aspx file from vb file

i have found that writing asp.net in the .aspx file is not recompiled as when written in .vb file, it return me to one of the good things of asp is that the speed when reloading the page with added changes, but writing in .vb file is more controlled code, so im asking if any one have a comment on what i have said

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old December 15th, 2003, 11:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When you write server code in the ASPX, it is compiled. It's just not compiled ahead of time. All .net code is compiled to Microsoft Intermediate Language (MSIL) which is then Just-In-Time (JIT) compiled to machine specific run-time code. By compiling in visual studio using code-behind files, you are manually executing the compile to MSIL (into the DLL). When IIS needs to execute the code, it still has to JIT compile from the DLL into machine code. It also compiles the ASPX page into a temporary DLL (in MSIL) when get's JIT compiled. Under both scenarios, the ASPX is getting compiled, you've just helped it by moving some of the server code into a precompiled DLL.

I almost exclusively use the code-behind model. It maintains the visual/logic separation or your markup and server code but more importantly it allows the classes within a project to work together. For a web application of any reasonable complexity you would need to use the code behind model. In order for page classes to utilize other classes they must all live within an assembly that contains them or can access them by reference to other assemblies. A self contained ASPX with inline server code lives as an isolated class entity making it very difficult to reference outside resource (like other classes).

What exactly do you mean by "more controlled code"? Is VB.net code written in-line with the ASPX markup "out of control"?

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
.aspx.vb file doesnt run arabuafef ASP.NET 2.0 Professional 7 March 18th, 2008 12:20 PM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
Read Text file and convert to Binary file VB.net sjlsysprg1 Pro VB.NET 2002/2003 4 June 29th, 2007 06:53 AM
Write .NET code in .ZIP File in place of .aspx savan_thakkar ASP.NET 1.0 and 1.1 Professional 3 November 2nd, 2006 08:28 AM
Calling a function from .vb file to aspx file !! NitinJoshi General .NET 4 February 10th, 2005 06:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.