When using razor syntax in asp.net webpages On top of the index (or the default or what ever is the start) I can put some razor code that start with @{ }.
I have 2 or 3 classes in another folder, they have some methods that I will need for my web site to work. and here is my questions
Does all my code for my website go between this bracket in my index page on top of the html tags and from here I call classes and methods but every thing runs here?
or in within this brackets I send variables values to the classes that are in another folder they execute the methods and send back the result to index and then is posted in the html doc?
example
Project X
Business Class folder
Class Adding with method Sum()
Class Grow with method Multiply()
App Data folder
Other Folders
Index.cshtml
About.cshtml
My index file where the app starts
@{ Adding A = new Adding;
int a=Sum();
Grow B = new Grow;
int b=Multiply();
}
<html>
//use of a and b here
</html>
As you can see the code in razor calls classes and methods that are in another folder. Question is: Does the code is executed only here in index? or when classes and method are called, the program goes to class Adding or Grow, execute the method and sends back the result to index?
can you point me to some info or tutorial?**