<script type="text/javascript">
        $("#LYF_Button1").click(function()
            {
               var username=document.getElementById("LYF_Text1").value;
               var userpass=document.getElementById("LYF_Password1").value;
               
                $.ajax
                ({
                  url:"WebService.asmx/Login",
                  type:"POST",
                  cache:false,
                  dataType:"xml",
                  data:"UserName=username&UserPassword=userpass",            
                  success:function(res)
                  {
                      var as = $(res).find("int").text(); 
                      alert(as);
                  }
                })
            })
      </script>WEB服务方法
public int Login(string UserName, string UserPassword)
    {
        if (string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(UserPassword))
        {
            return -1;
            
        }        UserDAL userdal = new UserDAL();
        UserInfo userData = userdal.Getuser(UserName);
        if (userData.UserPass == UserPassword)
        {
            return userData.UserID;
        }
        else
        {
            return 0;
        }
    }
请求WEB服务的一端是用的2个textbox来提供参数,但是参数老穿不过去,请大仙们支点下,感激不尽。