what is the difference between code inside a <script> tag and code in the code-behind file?

Discussion in 'ASP .Net' started by keithb, Mar 29, 2006.

  1. keithb

    keithb Guest

    What is the difference between code that exists inside the <html><script
    runat="server" > tag and code that exists in a code-behind file?

    Thanks,

    Keith
     
    keithb, Mar 29, 2006
    #1
    1. Advertising

  2. keithb

    Bruce Barker Guest

    in 1.1 the aspx file generates a class file that inherits from the
    codebehind (if one). code defined in <script> blocks belong to that class,
    and follows the scoping rules of inheritance (such as won't see private
    variables defined in the base class)

    in 2.0 the aspx file and the codebehind are both partial source files of the
    same class, so there is no difference (except where typed).

    -- bruce (sqlwork.com)




    "keithb" <> wrote in message
    news:%...
    > What is the difference between code that exists inside the <html><script
    > runat="server" > tag and code that exists in a code-behind file?
    >
    > Thanks,
    >
    > Keith
    >
    >
     
    Bruce Barker, Mar 29, 2006
    #2
    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. nitc
    Replies:
    2
    Views:
    3,357
    Kevin Spencer
    Jun 26, 2003
  2. Alan Silver
    Replies:
    37
    Views:
    3,828
    Alan Silver
    Feb 10, 2005
  3. jakk
    Replies:
    4
    Views:
    12,515
  4. shruds
    Replies:
    1
    Views:
    895
    John C. Bollinger
    Jan 27, 2006
  5. john woo
    Replies:
    1
    Views:
    162
    David Dorward
    Jun 29, 2005
Loading...

Share This Page