I tried the getting started code in vb from:
..and converted to C# for asp.net 2.0
But, when I try it, I get this error:
"Microsoft JScript runtime error: 'DataService' is undefined"
in a message box.
This is the markup:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services>
<asp:ServiceReference Path="~/DataService.asmx" />
</Services>
</asp:ScriptManager>
<div>
<br />
<br />
<AjaxData:GridView ID="MyGrid" runat="server">
</AjaxData:GridView>
<script type="text/javascript">
var _grid = null;
function pageLoad(sender, e)
{
_grid = $find('<%= MyGrid.ClientID %>');
DataService.TestData(onLoadSuccess);
}
function onLoadSuccess(result)
{
_grid.set_dataSource(result.rows);
_grid.dataBind();
}
</script>
</div>
</form>
</body>
</html>
I don't know what is wrong?
Thanks - Darren