Using functions


show more Using functions provides you with in-depth training on Developer. Taught by David Gassner as part of the ASP.NET Essential Training show less
please wait ...

Using functions

As your ASP.NET web pages become more complex, it's useful to be able to break out functionality into separate subroutines or functions. Once again both the C# and Visual Basic languages support this feature. I will describe here how to create a function and how to call it using both languages. I'll start again with C#. I'll open the file ProgrammingCSharp.aspx and then I'll save it under a new name, selecting File > Save As and I'll name the file FunctionsCSharp.aspx. When you declare a function in C#, you start with an access modifier.

The access modifier determines the availability of the function. If you are placing the function in the same page in which it's called, you can declare it as private. If the function should be available from both this page and from any pages that are derived from this page, that is, in object oriented terms that are subclasses of this page, you should use the access modifier protected and if you want the function to be callab...

Using functions
Video duration: 9m 25s 6h 24m Beginner Updated Feb 13, 2013

Viewers:

Using functions provides you with in-depth training on Developer. Taught by David Gassner as part of the ASP.NET Essential Training

Subjects:
Developer Web
Software:
ASP.NET
Author:
please wait ...