Pomster Pomster - 1 year ago 90
Ajax Question

POST 500 (Internal Server Error)

I am getting an POST 500 (Internal Server Error) on my website.

When testing on my local host i get no errors, only after publishing and running the site live do i get errors when trying to call my stored procedure.

The line number has pointed me to the line of code below in my Jquery File:

xhr.send( ( s.hasContent && s.data ) || null );

Here is the ajax call it fails on:

$.post("SaveSellGoods", { goodsId: goodsId, price: price, customerId: customerId }, function () {

I have checked and all the variables have the correct values.

Here is where it should move to, but i don't think it ever gets here:

public void SaveSellGoods(string goodsId, decimal price, int customerId)
DBH.GoodsStatusUpdate(int.Parse(goodsId), 3);
DBH.TransactionInsert(price, 2, int.Parse(Session["employeeId"].ToString()), int.Parse(goodsId), customerId);

I get this error across all browsers and i'm not sure what the cause is.

Could someone please tell me what it is i'm doing wrong or missing, or someway to get more information on this error.

Thanks in advance.

Answer Source

The problem at the end was with the parameters being the incorrect type.

Adding parse float to my price parameter fixed the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download