Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using Sencha Touch 2. Here I am trying to connect my Aspx web serive. But failure method only calling always.

Please find my code

JavaScript
Ext.Ajax.request
(
   {
	params: 
	{
	    Name:'Name', Password: 'Password'
	},
	//method:'post', get
	url: 'http://localhost:26907/WebService1.asmx/login',
         success: function(response) 
	{
	     alert('Success');
	     console.log("Success");
         },
	failure: function (response) 
	{
	     alert('Fail');
	     console.log(response);
         }
   }
);


My web service code is

HTML
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebApplication1
{
    /// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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 WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string login(string UserName, string Password)
        {
            return "Hello World";
        }
    }
}

What is the mistake I made it? Please help me how to solve this problem?
Posted
Updated 19-Mar-13 9:44am
v5
Comments
Prasad Khandekar 19-Mar-13 15:54pm    
Please have a look at this article ExtJS and .NET Web Services.
ZurdoDev 19-Mar-13 16:33pm    
What line of code is it failing on?

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