Asp.net (C #) prohibits cached files from being cached on the client,

Source: Internet
Author: User

Asp.net (C #) prohibits cached files from being cached on the client,

IIS caches the file to the client based on the file address and parameters so that it can access the content more quickly. If you want to cancel this mechanism, you need to disable the cache file.

I. programming methods

Response.Buffer = true;Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);Response.Cache.SetExpires(DateTime.Now.AddDays(-1));Response.Expires = 0;Response.CacheControl = "no-cache";

Ii. Code Method

Copy codeThe Code is as follows:
<% @ OutputCache Duration = "1" varybyparam = "none" Location = "None" %>


Is ASPNET in the C/S architecture?

ASP. NET developed B/S
C # winfrom is C/S

ASPNET (# c) and DIV + CSS

Asp.net is a platform. I don't know what versions others use. I use 3.5.
The foreground is the *. aspx page. The background is the. cs page. On this. cs page, you can call the background class to call the database.
Div + css is just a way to implement page layout and styles. The page structure is based on whether the master page is used or what is used.
In fact, you don't have to think about how difficult they are. Only get data. Only data is displayed.

If you are working on the frontend, you do not need to consider the background. how do you write your css. as long as it is used on the aspx page. there is no need to confuse html controls and server controls. They only run on the client and on the server. the server control will eventually become html text. so what should you do. because you only do layout and effect. only on the client. so you don't have to worry about that.

Let me give you an intuitive example. A button (the property runat = "server" runs on the server, that is, the server control), which is on your aspx page. how can you add styles to it. finally, when the user clicks it, the Code he executes will be in. the click event of the button in the cs page. after clicking the button, it will automatically execute the click event. The content of the click event is the background service class, data operations, and other operations. isn't that how to associate the front-end page with the back-end page? In fact, the aspx page is only a display page. The. cs page is actually connected to the frontend and backend. This is also an advantage of asp.net. The post-code!

Related Article

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.