Exforsys

Online Training

Doubt in asp.net

This is a discussion on Doubt in asp.net within the Microsoft .NET Tutorials and Articles forums, part of the Articles and Tutorials category; Hello What is difference in inline coding and code behind with asp.net. plz. any body explain me in detail ...


Go Back   Exforsys > Articles and Tutorials > Microsoft .NET Tutorials and Articles

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2005, 01:05 PM
Junior Member
 
Join Date: Sep 2004
Posts: 1
zubairsmd
Doubt in asp.net

Hello
What is difference in inline coding and code behind with asp.net.
plz. any body explain me in detail like, how that 2 are compiled. with code behind dll is created. whereas in inline it wont.
Which one performance wise best

regards
Zubair
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2005, 06:15 PM
Junior Member
 
Join Date: Feb 2005
Posts: 1
azamsharp
Re:Doubt in asp.net

The coding done in Classic Asp was known as inline coding where you can write Asp tags and directives in the same html file which contained the presentation of your application. The code below is an example of inline coding:



Private Sub Page_Load()
Response.Write _
(\"Hello About Visual Basic!\&quot
End Sub



As you see that your Asp code is mixed with the HTML code and it will be really hard to maintain clarity using inline approach.

Asp.net introduces another form of coding which is known as code behind model. In that model you can write the code in a separate file so that it does not mingle with the html code in the presentation layer.

When the page is run for the first time an assembly is created. Later if you change the page and compile again the previously created assembly is overwritten and new version is placed.

I hope thaty helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-19-2005, 10:32 AM
Junior Member
 
Join Date: Aug 2005
Posts: 3
Gubendran is on a distinguished road
Doubt in asp.net

Code Inline:

The Code inline model is now the default model for Visual Studio 2005.Any code you add to the page will automatically be added to a <script> block within the ASPX file instead of to a code behind class. However, Visual studio 2005 still displays the code in the code view except that code will be placed directly in the ASPX page instead of a separate class.

Code Behind:

Difference between a code-behind file in ASP.NET 1.x and ASP.NET2.0 is that a code-behind file is now a partial class rather than a full class that inherits from the ASPX page. A Partial class is a new .NET construct that allows you to define a single class in multiple source files. Partial classes remove the inheritance relationship that is present with the older code behind model.

Last edited by Gubendran; 08-19-2005 at 10:35 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-28-2006, 08:02 PM
Member
 
Join Date: Apr 2006
Posts: 85
cbdarts is an unknown quantity at this point
I believe you must be using the Inline coding method, zubairsmd.

Inline coding does not create a DLL, it is re-compiled every time it is executed (except for the code buffering thing, which lasts about 20 mins - which means it runs really well after its accessed once, but if there are 20 mins between uses its much slower than the DLL)

Creating a DLL using the code-behind technique is slow to code in but its way faster than inline code during execution. Besides it secures your sensitive code as well.

I recommend using the DLL option if speed is a problem.

Chaitanya
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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 On



All times are GMT -4. The time now is 02:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.