Professional Documents
Culture Documents
Populate Products With The Help of JQuery
Populate Products With The Help of JQuery
Write below script just before the end of <body> tag. Replace the localhost URL with your URL :
<script type="text/javascript"> $("#trsearchResult").hide(); $("#searchButton").click(function () { if ($("#search").val() != "") window.location = "http://localhost:50154/Search-Result.aspx?search=" + escape($ ("#search").val()); }); $("#<%=tbxSearch.ClientID%>").keyup(function () { if ($("#<%=tbxSearch.ClientID%>").val().length > 0) { $.ajax({ type: "GET", url: 'http://localhost:50154/Search-Result.aspx', data: 'search=' + $("#<%=tbxSearch.ClientID%>").val(), success: function (data) { if ($("#<%=tbxSearch.ClientID%>").val() != "") { $("#trsearchResult").show(); $("#searchResult").html(data); } else { $("#trsearchResult").hide(); } } }); } else { $("#trsearchResult").hide(); } }); </script>