Je ne sais pas exactement pourquoi cela se produit, mais au clic d'un bouton j'appelle un contrôle JQuery Ajax, après que je ne veux pas continuer à soumettre le formulaire, mais avant que la page est encore soumise.JQuery Ajax formulaire de soumission
<asp:ImageButton id="btnContinue" OnClick="btnContinue_Click" runat="server" OnClientClick="return false;" />
et jQuery:
$("#<%=btnContinue.ClientID%>").click(function() {
var currentpickupLocation = document.getElementById("<%=ddlPickupLocation.ClientID %>").value;
var currentpickupDate = document.getElementById("<%=txtPickupDate.ClientID %>").value;
var currentCulture = "<%= GetCulture() %>";
var params = $.toJSON({pickupLocation: currentpickupLocation, pickupDate: currentpickupDate});
$.ajax({
type: "POST",
url: "LocationService.asmx/GetBlackoutDates",
data: params,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(locations) {
return false;
}
});
});
Travaillé comme un charme, merci pour votre aide! – BoredOfBinary
Pas de soucis, a couru dans ce comme il ya un an, heureux d'avoir pu aider. –