json - add time in loading web service in windows phone -


this code load web service in app:

public loaddata()  {      initializecomponent();      postdata();  }   private void postdata()  {      uri uri = new uri("my web service url");      webclient client= new webclient();      client.headers[httprequestheader.contenttype] = "application/x-www-form-urlencoded";      client.uploadstringasync(uri);      client.uploadstringcompleted += client_uploadcomplete;  }   public void client_uploadcomplete(object sender, uploadstringcompletedeventargs e)  {     var test= jsonconvert.deserializeobject<main>(e.result);  } 

at point if web service takes more 10 seconds load data in variable test, message box or popup box open " slow connection please retry" along retry button again load postdata(); how possible add time in loading web service in wp please me on this.....

add timer event , start before asynchronous upload. event fires after 10 secs. if code reaches inside ur complete event disable timer.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -