code behind or inline-coding

  • Thread starter Newbie \(C#,Asp.net\)
  • Start date
N

Newbie \(C#,Asp.net\)

Hi
I have two simple questions that I make sure that I have underestood them

1) what is the main difference between inline coding and code behind besides
that code behind is part of DLL and is not visible like inline coding .

2) I am strill kind of confused why there is HTML server control when we
have equivalents in Web server controls ,why we should make an HTML control
to be run at server ?? what is the main difference betwwen these two guys?

thanks for your help
 
K

Karl Seguin

code behind provides intellisense (if you are using a tool) and better
compile-time error reporting. It gives you the illusion that your code and
presentation layer is separate which is good enough for most. If you are
using VS.Net, the benefits of codebehind are worth it (considering there
isn't a price to pay).

One of the reasons HTMLControls exist is to make porting html/asp code to
ASP.Net quick and easy. Simply add an id and a runat="server" and you
quickly have an object you can program against in code. Also, you need it
for things like file uploads and the such...

Karl
 
K

Kevin Spencer

Hi Newbie,
1) what is the main difference between inline coding and code behind besides
that code behind is part of DLL and is not visible like inline coding .

ASP.net is object-oriented, which means that so-called inline coding isn't
going to behave in the same way that it would in classic ASP. Classic ASP is
procedural, and program flow generally runs from top to bottom, with the
exception of any side-trips through functions and subs. As ASP.Net is
object-oriented, program flow jumps around from one class to another, and is
not linear. Using procedural techniques in object-oriented code is going to
unhappily surprise you, in terms of results. The bottom line is, when using
object-oriented programming technolgies, you must use object-oriented
programming techniques, or you're asking for the hassle of your life.
2) I am strill kind of confused why there is HTML server control when we
have equivalents in Web server controls ,why we should make an HTML control
to be run at server ?? what is the main difference betwwen these two guys?

Check out the following MSDN article:

http://msdn.microsoft.com/msdnmag/issues/01/09/asp/

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top