Recently, a function is provided to record the clicks of a user button when a user clicks a button and determine whether the clicks exceed a certain value. Because the page cannot be sent back when you need to click the button, the combination of JS and ashx is adopted. (The. ashx file is used to implement custom HTTP processing in Asp.net.ProgramAnother way to implement a custom HTTP handler is to customize the handler, such as trace. axd. Note: The ASPX page also relies on HTTP processing programs, but it is a complicated HTTP processing program)
However, in the process of using the browser cache, except for the first request to the. ashx file to interact with the background, only the cache value of the first request result will be returned for future requests. The solution is to add the followingCode:
Context. response. cache. setnostore ();
Alternatively, you can add random parameters to the URL of the request. ashx file, so that each request is considered a different request.