Refer this
This will be your WebMethod.
[WebMethod]
public static bool IsRoomAvailable(string customerId)
{
bool isAvailable = false;
// Write some code here to check the Availability
//and depending on the Sql outcome set isAvailable variable.
return isAvailable;
}
jQuery
This will be yuor Ajax Success method
function OnSuccess(response) {
if (response.d == "true") {
window.location.href = "Page1.aspx";
}
}
For more details please check this article.