A Simple Login Form with JQuery + ASP.NET 2.0 + Table adapters

A Simple Login Form with JQuery + ASP.NET 2.0 + Table adapters

Hello, can anybody please help me to solve the login form problems that was developed by JQuery and ASP.NET 2.0 in webform. Table adapters are used to access database data. 

The problems I am facing: -Although correct username and password are already submitted, the form cannot                                          redirected to home.aspx. The login page is continually showed. I think the                                                    problems are login.aspx file but I am not sure about it.

I wonder about the passing data way from both client side to server side. How to solve it?
                                      

The followings are my login.aspx code:

<link href="assets/scripts/jquery.mobile-1.0a3/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css" />

        <script src="assets/scripts/jquery/jquery-1.4.4/jquery-1.4.4.min.js" type="text/javascript"></script>
        
        <script type="text/javascript"> 
         $(document).bind("mobileinit", function(){
         $.extend(  $.mobile, { ajaxFormsEnabled: false });
         }
        </script>
       
        <script src="assets/scripts/jquery.mobile-1.0a3/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">              
function Submit1_onclick()
{
 x = document.getElementById("username").value;
 y = document.getElementById("password").value;

if(x!="" && y!="")
{
   function CheckUserLogin() {
     
   int n = PageMethods.checkLogin(x,y);
   if(n==2)
   {
    alert("success");
    document.location("home.aspx");
   }
     }
}
}
</script>

<form id="Form1" action="home.aspx" method="post" runat="server"> 
 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
  
<div data-role="fieldcontain">
<label for="lblError" name="lblError"></label><br />
<label for="username" name="username">username:</label>
<input type="text" name="username" id="username" /><br />

<label for="password" name="password">password:</label>
<input type="password" name="password" id="password"/><br /><br />

<input type="reset" value="reset" data-inline="true" data-icon="refresh" data-iconpos="left"/>
<input type="submit" value="login" data-inline="true" data-theme="b" data-icon="arrow-r" data-iconpos="left" id="Submit1" onclick="Submit1_onclick()"/>
    <asp:HiddenField ID="HUsername" runat="server" />
    <asp:HiddenField ID="HPassword" runat="server" />
</div>
</form>

-----------------------------------------------------------------------------------------------------------------------------------------------------------
The followings are my login.aspx.cs code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using DataSet1TableAdapters;

public partial class login : System.Web.UI.Page
{
    DataTable dt = new DataTable();

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    [System.Web.Services.WebMethod]
    public static int checkLogin(string user, string psd)
    {
        login l = new login();

        if (user != "" && psd != "")
        {
            AdUserTableAdapter ata = new AdUserTableAdapter();
            l.dt = ata.GetERPLoginData();

            foreach (DataRow dr in l.dt.Rows)
            {
                if (user.Equals(dr["ID"]) && psd.Equals(dr["PWord"]))
                {
                    return 2;
                }
            }
           
        }
        return 1;
    }

}

To who knows where is the problems and solutions, please feel free to give comment here. Thanks.