Functions are similar to subroutes with the difference being that functions return a value. Functions can be used when you want to run the same code against several pieces of data. Instead of writing the code out for each piece of data, write it once, put it in a function then call the function from within the body of the page. Place your function in either a script tag in the header or in your code-behind file.
Function getCompanyName() as String Return "Multimedia Designs" End Function Sub Page_Load(s as object, e as eventargs) lblmsg.text = getCompanyName() end Sub
On the asp.net page:
<asp:label id="lblmsg" runat="server" />