jquery - Ajax refreshing page -
on change of dropdown im reading drop down value , making on ajax call fetch data.i want refresh same page. tried this
$('#status').change(function(){ var status = $('#status').val(); $.ajax({ url : "partners.action", data: {status : status}, success : function(data) { alert(status); $("#status").html(data); } }); });
but not refreshing
solution 1:
you can page refresh using method proposed @neel. in case want refresh whole page , data back, first need store in database.
also, filling data in same control on observing .change
event.
replace $("#status").html(data);
$('#yourhtmlcontrol').html(data);
alternate method: way of doing use of querystring. can this.
success : function(data) { alert(status); $("#status").html(data); window.location="currentpageurl.aspx?data="+data; }
later can read querystring on page load , insert desired control using javascript or server side method.
hope helps.
Comments
Post a Comment