GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET
Go To First  |  Previous Question  |  Next Question 
 ASP.NET  |  Question 60 of 165    Print  
What is the difference between inline coding & code behind.

  
Total Answers and Comments: 5 Last Update: May 08, 2009     Asked by: ram 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 30, 2006 08:36:17   
Debuajm        

RE: What is the difference between inline coding & cod...

Coding in the Aspx page file using

< @ Page Language vb Strict True >

is inline code. you need code behind page to do the code. and coding in the .aspx.cs page is code behind


 
Is this answer useful? Yes | No
July 08, 2006 01:25:00   
rspsuba Member Since: March 2006   Contribution: 3    

RE: What is the difference between inline coding & cod...
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page. ie (.cs or .vb file) . regardsrajikiran
 
Is this answer useful? Yes | No
July 08, 2006 02:51:44   
dkarthikmca Member Since: June 2006   Contribution: 5    

RE: What is the difference between inline coding & cod...

inline-HTML page coding< page languge c# codebehind .name....aspx.cs AutoEventwireup false inherits ....... >.

codebehind--we are using .aspx(.vb or .cs). mean languge coding side

karthik.d

< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >< @ Page language c# Codebehind vp.aspx.cs AutoEventWireup false Inherits ClassicCarBase_Com.vp >


 
Is this answer useful? Yes | No
February 20, 2007 04:46:26   
Manish Srivastava        

RE: What is the difference between inline coding & cod...

When we write inline code we write code in the same page with Html code between scripting tags. So Each time when there is a request for page it compiles the code each time then server the page Like classic asp because inline code can not create Dll.
Where as in Code behiend file code write in seprate file from html file that is after compilation convert into dll which is muchfaster.


 
Is this answer useful? Yes | No
April 24, 2009 14:15:39   
aanand_agrawal Member Since: April 2009   Contribution: 8    

RE: What is the difference between inline coding & code behind.
This option is asked when you are


Add New Item - > Web Form - > Place Code In seperatefile



Codebehind

The code behind programming model adds another file to the webpage
that is called codebehind page . the codebehind page consist server side code
thus seperating serverside code from clientsidecode and markup. (e.g
XYZ.aspx.vb)



Sample ::

Default.aspx.vb

Partial Class _Default



Inherits
System.Web.UI.Page


Protected Sub
Page_Load(ByVal sender As
Object ByVal e As
System.EventArgs) Handles Me.Load

End Sub


End Class




Default.aspx


< @ Page Language "VB"
AutoEventWireup "flase"
CodeFile "Default.aspx.vb" Inherits "_Default"
>

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns "http://www.w3.org/1999/xhtml">




<head
runat "server">

<title>Untitled
Page</
title>



</head>


<body
>

<form

id "form1"
runat "server">

<div>


</div>



</
form>


</body>


</html>





InlineCode::

Example: Default.aspx

< @ Page Language "VB"

AutoEventWireup "flase"
CodeFile "Default.aspx.vb"

Inherits "_Default" >

<!
DOCTYPE

html
PUBLIC
"-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<script
runat "server">


Protected
Sub Page_Load(ByVal
sender
As
Object
ByVal e

As System.EventArgs)


End Sub

</
script>


<html xmlns "http://www.w3.org/1999/xhtml">


<head runat "server">


<
title>Untitled Page</title>


</head
>

<body>


<form

id "form1"
runat "server">


<div>


</div>

</form>


</body>

</html>


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape