How to forcibly refresh the same Http address multiple times in a short time in wp7

Source: Internet
Author: User
Tags datetime http request

Problem Description: if a Weibo client is being developed, one function is to follow someone. When the user does not follow someone, click the Follow button and the server returns "follow successful ", click the Follow button again (if the page is not refreshed in time due to "follow successful"), the server returns "you have followed this user ". In our program, each time a user clicks the Follow button, the same operation is actually executed, that is, an Http request is initiated. Because the get method is used, if the operation is the same, the requested url is also the same. The problem occurs. During the debugging process, click the Follow button multiple times in a short period of time. The received server return value is "follow successful", and "you have followed this user" is not displayed as scheduled ".

Problem Analysis: There is no problem on the server side, so the problem is on the client side. Later, I finally confirmed the problem as "cache "......

 

Tip: Add "& _ t =" + DateTime. Now. Ticks. ToString () to the request url. If there is no parameter in the Url, add "? _ T = "+ DateTime. now. ticks. toString (), because the time of each request is different, the request Url is artificially different. This method is commonly used by many AJAX developers, everyone knows how to pass values through Get ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.