my select Query is string strSQL = "Select a.facreceiptitemid ,a.itemid,a.batchno,to_char(a.mfgdate,'mm/yyyy') as mfgdate,to_char(a.expdate,'mm/yyyy') as expdate,a.MRP,a.SingleUnitPrice,a.marginPercentage,a.sellingprice,a.saletaxid," +
"a.TaxPercentage,a.SaleTaxPercentage,a.SaleTaxType,a.sellingpricesku from tbfacilityreceiptitems a " +
"inner join masitems it on (it.itemid = a.itemid)" +
"inner join masitemcategories cat on (cat.categoryid = it.categoryid)" +
"where cat.categoryid =" + ddlCategory;
Please help..How to write a onchange function for this query
Please help..How to write a onchange function for this query
Manoj BhoirPosted Apr 15, 2015, 3:31 AM
Please check this code snippet you will get some idea.
//Server side code
public string GetQueryOutput(string param1)
{
// your query execution part
return string.Empty;
}
//Client side script code
$('#ddlCategory').change(function () {
$.ajax({
type: "POST",
url: "../GetQueryOutput",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify({ 'param1': $('#ddlCategory').val() }),
success: function (data) {
// Success
},
error: function (err) {
//Error
}
});
});
ramya bharathPosted Apr 14, 2015, 9:24 PM
2. Write the function calling ajax script to call the server side function