Define function : function « Language Basics « ASP.NET Tutorial






<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>ASP.NET Functions</title>
    <script runat="server" language="C#">

      string getName() 
      {
        return "Abc";
      }

      void Page_Load() 
      {
        messageLabel.Text = getName();
      }
    </script>
  </head>
  <body>
    <form runat="server">
      <asp:Label id="messageLabel" runat="server" />
    </form>
  </body>
</html>








2.4.function
2.4.1.Define and call function in asp.net page (C#)
2.4.2.Return value from function (VB)
2.4.3.Define function
2.4.4.Create a function (VB)