Please help i am trying to assign a value to a string but the string comes with NaN
Dim saleprice As String = Request.QueryString("saleprice")
this bring this "8000NaN" instead on 8000 how can i correct this
<script src="../Scripts/jquery-1.8.3.min.js"></script>
<script src="ASPSnippets_Pager.min.js"></script>
<script type="text/javascript">
$(function () {
GetCustomers(1);
});
$("[id*=txtSearch]").live("keyup", function () {
GetCustomers(parseInt(1));
});
$(".Pager .page").live("click", function () {
GetCustomers(parseInt($(this).attr('page')));
});
function SearchTerm() {
return jQuery.trim($("[id*=txtSearch]").val());
};
function GetCustomers(pageIndex) {
$.ajax({
type: "POST",
url: "Searchagain.aspx/GetCustomers",
data: '{searchTerm: "' + SearchTerm() + '", pageIndex: ' + pageIndex + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
}
var row;
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var customers = xml.find("Customers");
if (row == null) {
row = $("[id*=SearchGrid] tr:last-child").clone(true);
}
$("[id*=SearchGrid] tr").not($("[id*=SearchGrid] tr:first-child")).remove();
if (customers.length > 0) {
$.each(customers, function () {
var customer = $(this);
$("td", row).eq(0).html($(this).find("itemcode").text());
$("td", row).eq(1).html($(this).find("stockitem").text());
$("td", row).eq(2).html($(this).find("itemsize").text());
$("td", row).eq(3).html($(this).find("Colour").text());
$("td", row).eq(4).html($(this).find("costprice").text());
$("td", row).eq(5).html($(this).find("saleprice").text());
$("td", row).eq(6).find("a").attr("href", "Client.aspx?itemcode=" + encodeURI($(this).find("itemcode").text()) + "&stockitem=" + encodeURI($(this).find("stockitem").text()) + "&itemsize=" + encodeURI($(this).find("itemsize").text()) + "&Colour=" + encodeURI($(this).find("Colour").text()) + "&Costprice=" + encodeURI($(this).find("costprice").text()) + "&saleprice=" + encodeURI($(this).find("saleprice").text()) + + "&account=" + encodeURI($(this).find("account").text()));
$("[id*=SearchGrid]").append(row);
row = $("[id*=SearchGrid] tr:last-child").clone(true);
});
var pager = xml.find("Pager");
$(".Pager").ASPSnippets_Pager({
ActiveCssClass: "current",
PagerCssClass: "pager",
PageIndex: parseInt(pager.find("PageIndex").text()),
PageSize: parseInt(pager.find("PageSize").text()),
RecordCount: parseInt(pager.find("RecordCount").text())
});
$(".stockitem").each(function () {
var searchPattern = new RegExp('(' + SearchTerm() + ')', 'ig');
$(this).html($(this).text().replace(searchPattern, "<span class = 'highlight'>" + SearchTerm() + "</span>"));
});
} else {
var empty_row = row.clone(true);
$("td:first-child", empty_row).attr("colspan", $("td", row).length);
$("td:first-child", empty_row).attr("align", "center");
$("td:first-child", empty_row).html("No records found for the search criteria.");
$("td", empty_row).not($("td:first-child", empty_row)).remove();
$("[id*=SearchGrid]").append(empty_row);
}
};
</script>
</head>