c# - Page method multiple callbacks -


I am calling the image on an image slider to display an image from a database to show a picture with an image . The problem is that I am getting many callbacks. Does anyone know how to solve this problem?

The code that I am using for the page method:

  var contextArray = "img"; PageMethodConcept = {callServerSideMethod: Function (id) {PageMethods.GetItemLargeImage (ID, PageMetConceptEllbackback, PageMapContactor.filecolalkback, referrals); }, Callback: function (results, user contexts, image preview) {// warning (results); If (userContext = "img") {// img source the result with the document .getElementById ("displayPreviewImage"). Src = Results; return false; }}, Failcallback: function (result, user contaxes) {warning ("unsuccessful"); }}  

Code to set the timer:

  var alertTimer = 0; If (warning timer == 100) {warning ("time 100"); AlertTimer = setTimeout (pageMethodConcept.callServerSideMethod (this.id), 0); } Other {alertTimer = setTimeout (PageMetConcept.loltercadermode (this.id), 100); Warning ("time"); }  

Do you think the timer code is doing correctly?

if (alertTimer == 100) {...

100? What is 100?

You should do something like this:

  if (alertTimer! = 0) {/ * timeout pending * / clearTimeout (alertTimer); AlertTimer = ...} and {/ * set timeout * / alertTimer = ...}  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -