Using out Parameters (C#) : Function « Language Basics « ASP.Net






Using out Parameters (C#)

<%@ Page Language="C#" %>
<script runat="server">

    void Page_Load()
    {
        int a = 1;
        int b;
        Increment(a, out b);
        lblMessage.Text = b.ToString();
    }
    
    void Increment(int Number, out int Result)
    {
        Result = Number + 1;
    }

</script>
<html>
<head>
    <title>Demonstration of using out Parameters</title>
</head>
<body>
    <asp:Label id="lblMessage" runat="server"></asp:Label>
</body>
</html>

           
       








Related examples in the same category

1.Define and call function in a page (VB.net)
2.Page level procedure (VB.net)
3.Define function to change 'HR' length (C#)
4.Function Parameter passed by Reference (C#)
5.Function Parameter passed by Value (C#)
6.Simple function without parameters (C#)
7.Define and call function (C#)
8.Call function (C#)
9.Function local variable (C#)