Hello Guys,
I referred below code
The Code (JavaScript functions) is working fine without postback but after postback the JavaScript functions are not working!
Below is my code!
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script>
function AppendData(data) {
$("#tblData").append(data);
}
</script>
<script>
function GetBookID(bookType) {
var clientID = $("[id$=hfCID]").val();
var fy = $("[id$=hfFY]").val();
var month = $("[id$=ddlMonth]").val();
var param = clientID + "@" + fy + "@" + month + "@" + bookType;
if (String(month) != "--SELECT--" && String(bookType) != "--SELECT--") {
$.ajax({
type: "POST",
url: 'WebService.asmx/GetBookID',
data: "{'param': '" + param + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$("[id$=hfRecordID]").val(response.d);
},
error: function (response) {
showAlert(0, response.responseText);
},
failure: function (response) {
showAlert(0, response.responseText);
}
});
} else {
showAlert(0, "Please Select Month & Book Type!");
}
}
function pageLoad(sender, args) {
$("body").on("change keyup", "[id*=txtOGST]", function () {
$(this).val($.trim($(this).val()));
var row = $(this).closest("tr");
var taxableAmount = parseFloat($(this).val());
var gst = parseFloat(row.find($("[id*=hfGST]")).val());
var gstValue = 0;
taxableAmount = isNaN(taxableAmount) ? 0 : taxableAmount;
gst = gst / 100;
gstValue = (taxableAmount * gst).toFixed(2);
$("[id*=txtIGST]", row).val(gstValue);
});
$("body").on("change keyup", "[id*=txtLGST]", function () {
$(this).val($.trim($(this).val()));
var row = $(this).closest("tr");
var taxableAmount = parseFloat($(this).val());
var gst = parseFloat(row.find($("[id*=hfGST]")).val());
var gstValue = 0;
taxableAmount = isNaN(taxableAmount) ? 0 : taxableAmount;
gst = gst / 100;
gstValue = ((taxableAmount * gst) / 2).toFixed(2);
$("[id*=txtCGST]", row).val(gstValue);
$("[id*=txtSGST]", row).val(gstValue);
});
}
</script>
</asp:Content>