code behind or inline-coding

Discussion in 'ASP .Net' started by Newbie \(C#,Asp.net\), Nov 10, 2004.

  1. 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
     
    Newbie \(C#,Asp.net\), Nov 10, 2004
    #1
    1. Advertising

  2. Newbie \(C#,Asp.net\)

    Karl Seguin Guest

    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

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    " Newbie (C#,Asp.net)" <> wrote in message
    news:...
    > 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
    >
    >
     
    Karl Seguin, Nov 10, 2004
    #2
    1. Advertising

  3. 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.

    " Newbie (C#,Asp.net)" <> wrote in message
    news:...
    > 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
    >
    >
     
    Kevin Spencer, Nov 10, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mitch A

    inline code VS page behind code

    Mitch A, Nov 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,518
    Chris R. Timmons
    Nov 2, 2003
  2. Anders M

    Using inline-code with code behind.

    Anders M, Apr 28, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    7,566
    Karl Seguin
    Apr 28, 2005
  3. Kamal Ahmed
    Replies:
    1
    Views:
    5,280
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
    Oct 25, 2005
  4. Replies:
    8
    Views:
    745
    Kevin Spencer
    Dec 9, 2005
  5. John Dalberg

    Tool to move inline code to code behind?

    John Dalberg, Mar 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    359
    Alvin Bruney [MVP]
    Mar 22, 2007
Loading...

Share This Page