codice:
<head>
<script type="text/javascript">
function plusOne(id){
$.ajax({
url: "plusOne.asp?id="+id,
cache: false,
success: function(html){
$('#quantity'+id).html(html);//aggiorna la cella con le quantità
}
});
}
</script>
</head>
<body>
<tr>
<td>
Descrizione prodotto
</td>
<td id="quantity<%=idProdotto%>">
13
</td>
<td>
<input type="button" onClick="plusOne('<%=idProdotto%>')">
</td>
</tr>
plusOne.asp
codice:
'Leggi la quantià
SQL="Select Quantity From Prodotti Where ID="&Request.Querystring("id")
quantity=quantity+1 'sommi uno
SQL="Update Prodotti Set Quantity="&quantity&" Where id="&Request.Querystring("id")
Response.Write(quantity) 'per aggiornare la cella con le quantità
Si potrebbe fare con un unica query ma la logica è quella...