WebClient download weird behavior

二次信任 提交于 2020-01-06 04:59:26

问题


It seems that i have this weird behavior in my Web Client My application goes in this scenario:
1-user browse topics and it's replies (Loaded from the web using URL & DownloadStringAsync)
2-he add a reply in the topic
3- I re-load the replies of the comment again from the web

But the new added reply don't appear on the new downloaded result although it appears when viewing the URL on the Web , The reply appears only if the application is closes and re-opened.

I want to view the reply in the page as soon the user post it


回答1:


WebClient caches urls (and responses) on Windows Phone.* You could:

  • send a different url each time. Add a phony search item on the url like ?phonyid=1 and increment it each time.
  • Specify on your url page on server to not allow the browser to cache.

*my first reference for this behavior is Timdam's blog entry at http://goo.gl/nqs27, but I've also seen this happen in practice.



来源:https://stackoverflow.com/questions/9177698/webclient-download-weird-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!