EDN Admin
Well-known member
Im trying to call a c# function from a javascript function:
In my default.aspx I have following code: (javascript)<script type="text/javascript
function App() {
var temp;
temp = PageMethods.Connect();
alert(temp);
}
</script>
(HTML)<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent
<div class="menuContent
#" onclick="App(); blabla!
<div id="navTreeContainer
<div id="navtree
</asp:Content>
Default.aspx.cs[WebMethod]
public static string Connect()
{
string test;
test = "test";
return test;
}When I try this out nothing happens.
I dont know what I do wrong here...
Someone that can help me please ?
Thanks!
View the full article
In my default.aspx I have following code: (javascript)<script type="text/javascript
function App() {
var temp;
temp = PageMethods.Connect();
alert(temp);
}
</script>
(HTML)<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent
<div class="menuContent
#" onclick="App(); blabla!
<div id="navTreeContainer
<div id="navtree
</asp:Content>
Default.aspx.cs[WebMethod]
public static string Connect()
{
string test;
test = "test";
return test;
}When I try this out nothing happens.
I dont know what I do wrong here...
Someone that can help me please ?
Thanks!
View the full article