use Jquery ajax in your code pass all the form inputs to your webmetod.
Here is Clint side code
$(".txtDescription").on('change', function() {
if($(this).val()=='' &&$("#drpdownlistState").val()=="SALES"
{
$('#txtVatPercent1').val("5");
$('#txtSno1').val("1");
}
else if(your condition)
{
$('#txtVatPercent1').val("5");
$('#txtSno1').val("1");
}
else
{
$('#txtVatPercent1').val("5");
$('#txtSno1').val("1");
}
$.ajax({
type: "POST",
url: "/Services/Webform1.aspx/DescriptionChange",
data: "{txtDescription1: $('#txtDescription1').val(),
drpdownlistState: $('#drpdownlistState').val(),
txtVatPercent1: $('#txtVatPercent1').val(),
txtSno1: $('#txtSno1').val(),
txtcustomername: $('#txtcustomername').val(),
}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$("#txtPrice1").val(data.price);
$("#DropDownListUOM1").val(data.uom);
},
failure:function(data){
alert("failed");
}
});
});
Here is your server side code
Add this method in your aspx file
[WebMethod]
public static string DescriptionChange(string txtDescription1, string drpdownlistState,string
txtVatPercent1, string txtSno1,string txtcustomername)
{
var chk;
string desname = txtDescription1.Text.ToString();
qpdataset1 = getqtyandprice(desname);
DataSet dsCustomerChecking = GetRequiredDataTable("SELECT * FROM TAXINVOICE where CUSTOMERNAME = '" + txtcustomername.Trim() + "'");
if (dsCustomerChecking.Tables[0].Rows.Count > 0)
{
if (qpdataset1.Rows.Count > 0)
{
chk = new
{
price= qpdataset1.Rows[0]["UnitPrice"].ToString() ,
uom= qpdataset1.Rows[0]["UOM"].ToString();
};
}
}
return JsonConvert.SerializeObject(chk);
}