A WebMethod must be marked as 'Static':
[WebMethod]
public static bool Login(string user , string pass)
{
pass ="TxtPassword.Text";
user ="TxtUserName.Text";
string username = "Login";
string Password = "Login";
if (user == username && pass == Password)
{
return true;
}
else
{
return false;
}
}