在asp.net中替代a控件的用途是什么 [英] what is the use of substitutiona control in asp.net

查看:59
本文介绍了在asp.net中替代a控件的用途是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net中使用替代控件是什么?

what is the use of substitution control in asp.net

推荐答案

在MSDN上有很好的记录:
http://msdn.microsoft.com/en-us/library/ms228212.aspx [ ^ ]

通过Substitution控件,您可以在页面上创建可以动态更新的区域,然后将其集成到缓存的页面中.

使用Substitution控件指定要在其中显示动态内容的输出缓存的Web页面的一部分.替换控件为部分缓存了大部分内容的页面提供了简化的解决方案,以进行部分页面缓存.您可以输出缓存整个页面,然后使用替换"控件指定页面中不受缓存影响的部分.高速缓存的区域仅执行一次,并从高速缓存中读取,直到高速缓存条目到期或清除.每次请求页面时都会执行动态区域.此缓存模型简化了主要是静态页面的代码,因为您不必封装要在Web用户控件中缓存的部分.例如,在您的页面包含静态内容(例如新闻故事)和显示广告的AdRotator控件的情况下,此缓存模型很有用.新闻故事不会经常更改,这意味着可以对其进行缓存.但是,每次用户请求页面时,您都想显示一个新的广告. AdRotator控件直接支持缓存后替换,并且无论页面是否被缓存,每次页面回发时都会呈现一个新广告.
It''s well documented on MSDN:
http://msdn.microsoft.com/en-us/library/ms228212.aspx[^]

The Substitution control lets you create areas on the page that can be updated dynamically and then integrated into a cached page.

Use the Substitution control to specify a section of an output-cached Web page where you want to display dynamic content. The Substitution control offers a simplified solution to partial page caching for pages where the majority of the content is cached. You can output-cache the entire page, and then use Substitution controls to specify the parts of the page that are exempt from caching. Cached regions execute only once and are read from the cache until the cache entry expires or is purged. Dynamic regions execute every time that the page is requested. This caching model simplifies the code for pages that are primarily static, because you do not have to encapsulate the sections to cache in Web user controls. For example, this caching model is useful in a scenario where you have a page that contains static content, such as news stories, and an AdRotator control that displays advertisements. The news stories do not change frequently, which means that they can be cached. However, every time that a user requests the page, you want to display a new advertisement. The AdRotator control directly supports post-cache substitution and renders a new advertisement every time that the page posts back, regardless of whether the page is cached.


http://msdn.microsoft.com/en-us/library/ms228212.aspx#Scenarios [


报价:

asp.net中替代控件的用途是什么?

what is the use of substitution control in asp.net?


Substitution控件在输出缓存的Web页面上指定了一个区域,该区域免于缓存.使用Substitution控件可以在输出缓存的Web页面上指定一个部分,您希望用动态内容代替该控件.

请遵循以下类似的详细信息:
替换Web服务器控件概述 [


The Substitution control specifies a section on an output-cached Web page that is exempt from caching. Use the Substitution control to specify a section on an output-cached Web page where you want dynamic content substituted for the control.

Follow the like below for more information:
Substitution Web Server Control Overview[^]


--Amit


这篇关于在asp.net中替代a控件的用途是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆