0
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            debugger;
            var counter = "test";
            WebApplication1.Service1.DoWork(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType);
        });
        function ResultLoadMainGridProductType() {


        }
        function ErrorLoadMainGridProductType() { 


        }
    </script>
    <form id="form1" runat="server">    
    <div>
    <asp:ScriptManager ID="ScriptManager" runat="server">            
            <Services>
                <asp:ServiceReference Path="~/Service1.svc" />
            </Services>
        </asp:ScriptManager>
    </div>
    </form>
</body>
</html>

Code fails on WebApplication1.Service1.DoWork(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType); Error: Error of implementation of Microsoft Jscript: "WebApplication1" is not certain. WebApplication1 - the namespace... then I watch it it undefined on javascript code working. How make it be there??

1
  • Is WebApplication1.Service1.DoWork a serverside method? Commented Nov 18, 2011 at 12:54

1 Answer 1

0

Try

$(document).ready(function () {
    debugger;
    var counter = "test";
    var service1 = new WebApplication1.Service1();
    service1.DoWork(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType);
});

Also check to make sure that the javascript file jsdebug is in your loaded scripts.

Sign up to request clarification or add additional context in comments.

2 Comments

the same error on line: var service1 = new WebApplication1.Service1()
Is jsdebug present? What happens when you navigate directly to the WCF Service? e.g. localhost:(portnumber)/Service1.svc ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.