Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
i have made webservice, and i am trying to consume it using javascript, but when i call the webservice method it gives the error Webservice not defined. I have given reference of it .
C#
<pre lang="c#">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<services>
<asp:ServiceReference Path="../WebService.asmx" />


my method
C#
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
    CultureInfo cul = new CultureInfo("gu-IN", true);
    protected sdData s = new sdData();
    protected component comp = new component();
    public ClsVB objvb = new ClsVB();
    DBAccess dbAccess = new DBAccess();

    public WebService()
    {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string SubmitDDIPo(string txtCaseNoDDIPO, int txtDDIPO, int txtAmount, string txtDDDate, string txtBank, string District_Code )
    {



javascript method calling

JavaScript
<script type="text/javascript">
            function addDDIPO() {
                "DDIPOdiv".Obctrl().style.display = "block";
                "fadeDiv".Obctrl().style.display = "block";
              
            }
            function submitDDIPO()
             {
                 WebService.SubmitDDIPo("txtCaseNoDDIPO".Obctrl().value, "txtDDIPO".Obctrl().value, "txtAmount".Obctrl().value, "txtDDDate".Obctrl().value, "txtBank".Obctrl().value, Session["District_Code"].ToString(), ResultSubmitSucess, ResultFailure);
             }
            </script>

is that something i missed?
please help
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900