ASP.net ページメソッドを使用しています。私が抱えているこの問題は、特定のブラウザでは機能しないということです。たとえば、IE、Opera Safari、新しい Firefox などです。Chrome で動作します。私はこれを見つけましたが、私の場合は役に立ちませんでしたhttp://www.carlj.ca/2008/06/18/fixing-firefoxs-ns_error_not_available-error-when-using-pagemethods/どんな助けでも大歓迎です。
<asp:ScriptManager ID=”scManager″ enablepagemethods=”true” runat=”server” />
<asp:Button ID="btnBuyNow" runat="server" Text="Buy Now" OnClientClick="AddProductToCart()" />
<script type="text/javascript">
function AddProductToCart() {
//hard coded values for testing, productId, quantity
PageMethods.AddProduct(142, 1);
window.location.href = '../Cart.aspx';
}
</script>
[System.Web.Services.WebMethod]
public static void AddProduct(string prodId, string quantity)
{
//adding product to cart
//When testing with Chrome breakpoint is hit,
//All other browsers dont hit break point
CurrentCart.AddProduct(prodId, quantity);
}