MyITBlog.com - IT Professionals Online Journal
 
  Home  |   Site News  |   About Us  |   Privacy  |   FAQ  |   Contact   Add Blog Entry  |  Login  |  Register   
 My Account
Username
Password
Remember me
Lost Password?


 Categories


  HOME  >  ProgrammingPrint


0
Votes
Code Behind Vs Inline Code in Programming   
by masterkey on 15 Nov 2005, 05:32     Read masterkey's Blog
Total Hits: 708    Comments: 0   

Hello!,
 
While working on ASP.NET just a thought came in mindabout CodeBehind Vs Inline Code. After searching on various articles Ifound some interesting issues for you to see.
 
When VS-2003 came in to market it supports Code behind by default.
 
The main thing focussed when Code Behind came was " Separating UserInterface from actual programming.This means graphic designers wouldlook for only design matters while programmers work their way."

The main advatage of Code behind supposed is :
 
The ability to wire up intrinsic and customevents, using ASP.NETintrinsic and custom servercontrols such as DataGrids,repeaters, dropdown listboxes and many others.

The compiler can also do type checking andallow full IntelliSense whenusing code-behind files.
        
It’s possible to compileapplications that haveerrors in the inline code which become apparentonly when thefinal
code is executed.
    

While those who thinks Inline coding is more useful they complains:
 
VisualStudio .NET has almost no support for coding within an ASPX pageusing< script runat="server> inline code. No Intellisense available at the time of inline coding.


Normally VS.NET will automatically compile the .vb file into a .dll and place it in your application's /bin

directory.TheCodebehind attribute is completely ignored by the ASP.NET runtime.
It is only used at design time by Visual Studio .NET to associate fileswith their codebehind class files
during development. Since VS.NETprojects compile all files in the same project into a single assembly
that is placed in the /bin folder, there is no need for any runtime JITcompilation of the codebehind files
- the assemblies are all found inthe /bin folder. This makes for efficiency of code execution because
the code for multiple pages, Global and other classes are all in asingle assembly in memory, and
also can help prevent problems by nothaving lots of strangely - named JIT – compiled
assemblies in theTemporary ASP.NET Files directory.



Nowthis is all people says. One more step has been taken by Microsoft tocontinue this
discussion by announcing Default Inline coding support inVS-2005.


Microsot Says: "It created some interesting inheritance issues and forced the developer to
 keep track of two files
for each Web page.Although ASP.NET 2.0 still supports both of these
models.In ASP 2.0 set the code inline by default."


Clicck heer CheckAt:                                                                <ahref:"http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/migratefromaspnetto2.asp#migratefromas">http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/migratefromaspnetto2.asp#migratefromas</a>

pnetto2_topic5

Now the question is What is the factor which turns microsoft's mind again to Inline Coding?

Please feel free to post your comments on this.

Thanks for all who help me to work out on these things.

You can check the references on :

http://www.eggheadcafe.com/articles/20030518.asp


 

Post Comment

Copyright © 2008 MyITBlog.com