Calling a c# function from a Javascript method
<p>I'm trying to call a c# function from a javascript function:</p>

<p>In my <strong>default.aspx</strong> I have following code: (javascript)</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function App() {
        var temp;
        temp = PageMethods.Connect();
        alert(temp);
    }
&lt;/script&gt; 
</code></pre>

<p>(<strong>HTML</strong>)</p>

<pre><code>&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
    &lt;div class="menuContent"&gt;
        &lt;p&gt;&lt;a href="#" onclick="App();"&gt;blabla!&lt;/a&gt;&lt;/p&gt;
        &lt;div id="navTreeContainer"&gt;
            &lt;div id="navtree"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/asp:Content&gt;
</code></pre>

<p><strong>Default.aspx.cs</strong></p>

<pre><code>[WebMethod]
public static string Connect()
{
    string test;
    test = "test";
    return test;
}
</code></pre>

<p>When I try this out nothing happens.</p>

<p>I don't know what I do wrong here...</p>

<p>Someone that can help me please ? </p>

<p>Thanks!</p>
