Hello!
I am receiving the scripting error message when I open the WebServices.aspx.
Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: element
Code:
<%@ Page Title="Web Services Demo" Language="VB" MasterPageFile="~/Masterpages/FrontEnd.master" AutoEventWireup="false" CodeFile="WebServices.aspx.vb" Inherits="Demos_WebServices" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Services>
<asp:ServiceReference Path="~/WebServices/NameService.asmx" />
</Services>
</asp:ScriptManagerProxy>
<input id="Text1" type="text" />
<input id="Button1" type="button" value="Say Hello" />
<input id="SayHelloPageMethod" type="button" value="Say Hello with a Page Method"/>
<script type="text/javascript">
function HelloWorld()
{
var yourName = $get('YourName').value;
NameService.HelloWorld(yourName, HelloWorldCallback);
}
function HelloWordPageMethod()
{
var yourname = $get('YourName').value;
PageMethods.HelloWorld(yourname, HelloWorldCallback);
}
function HelloWorldCallback(result)
{
alert(result);
}
$addHandler($get('SayHello'), 'click', HelloWorld);
$addHandler($get('SayHelloPageMethod'), 'click', HelloWordPageMethod);
</script>
</asp:Content>
WebServices.aspx.
vb
Code:
Imports System.Web.Services
Partial Class Demos_WebServices
Inherits BasePage
<WebMethod()>
Public Shared Function HelloWorld(ByVal yourname As String) As String
Return String.Format("Hello {0}", yourname)
End Function
End Class
The Nameservice.
vb worked perfectly, but this error, even when I ask it to continue, is stopping the code.
Thanks!