Code in ASP or Class

  • Thread starter Thread starter Giovanni
  • Start date Start date
G

Giovanni

Hello,

I am new with ASP.net. I have a simple question.
Where would it be better to have the code for a function ?
in the Control within the ASP file; or in a class (ex. C# class) and then the
function called from the ASP file.

Thanks,

Giovanni
 
You can't write a function outside a class.

If you write scripting in "the ASP file" you are writing in the Page class,
or rather, the class that inherits your CodeBehind Class, which inherits the
System.Web.UI.Page class. It is extremely important to understand these
principles of OOP in order to be successful with ASP.Net.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
Back
Top