c# - Jquery Ajax call in asp.net Progress Bar update -
i doing jquery ajax call in asp.net, getting value database in textbox , on base of making jquery progressbar. getting value in textbox, not taking value of progress bar first time, have reload page value of progress bar.
below code
$(function () { getvalue(); var l_count= parseint($("#txtcount").val()); $("#sliderlicense").progressbar({ max: 100, value: l_count }); }); function getvalue() { $.ajax({ type: "post", url: "mypage.aspx/getcount", //url point webmethod contenttype: "application/json; charset=utf-8", datatype: "json", success: function (result) { $("#txtcount").val(result.d); }, error: function () { alert('error'); } }); } [system.web.services.webmethod()] public static string getcount() { //get values db , return }
i tried document.ready no luck, event of jquery should use make progress bar on first time.
try this:
async:false, add ajax call
$(document).ready(function(){ getvalue(); var l_count= parseint($("#txtcount").val()); $("#sliderlicense").progressbar({ max: 100, value: l_count }); }); }) function getvalue() { $.ajax({ type: "post", url: "mypage.aspx/getcount", //url point webmethod contenttype: "application/json; charset=utf-8", datatype: "json", async:false, success: function (result) { $("#txtcount").val(result.d); }, error: function () { alert('error'); } }); }
Comments
Post a Comment