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

K

keithb

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
 
B

Bruce Barker

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)
 

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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top