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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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!\" ![]() 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. |
|
|||
|
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. |
|
|||
|
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 |
![]() |
| Thread Tools | |
|
|