jquery - How to show/hide progressbar for PageMethods? -


I am developing web applications using an ASP.NET Framework 4.0. I am using a lot of pagemods in my application. I. My application is fully AJAX enabled. I am not using UpdatePanel to avoid partial postback of the page. In my scenario, I want to show the progress bar when an AJAX request is made by PageMathies. I can not use UpdateProgress because it is connected to UpdatePanel which I am not using. Before I call the function, I can show the progress bar & amp; Onsuccess I can hide it like

  function callPageMethod () {$ ("# progressDiv"). Show (); PageMethods.GetCurrentDate (onSuccess); } Function Onsuccess (results) {$ ("# progressDiv"). Hide (); Warning (result); }   

These methods work fine but for me, show & amp; Hide code for each & amp; Every page method, such as my page has so many pagemates, how do I write a general method that will show / hide the progress bar for each AJAX request?

If you look for ways to separate and share calls to hide and show a method In general, you have a JS function that does $ ("# progressDiv"). Show () or $ ("# progressDiv"). Hide () Such a function can be evenly identical to everyone, and each page appears as a parameter compared to each parameter from the place of collocation, and you will call this function.

I think that you can not really do a lot because in fact every page method will require invoxation to be different and every OnSuccess case behaves differently on depention so those handlers should be different.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -