Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / AdPostCacheSubstitution.cs / 1 / AdPostCacheSubstitution.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * The class is used internally to handle post-cache substitution mechanism in * AdRotator. * * Copyright (c) 2002 Microsoft Corporation */ namespace System.Web.UI.WebControls { using System.Globalization; using System.IO; using System.Web.Util; internal class AdPostCacheSubstitution { private AdRotator _adRotatorHelper; private AdPostCacheSubstitution() {} internal AdPostCacheSubstitution(AdRotator adRotator) { _adRotatorHelper = new AdRotator(); _adRotatorHelper.CopyFrom(adRotator); _adRotatorHelper.IsPostCacheAdHelper = true; _adRotatorHelper.Page = new Page(); } internal void RegisterPostCacheCallBack(HttpContext context, Page page, HtmlTextWriter writer) { // Assumption: called from AdRotator's Render phase HttpResponseSubstitutionCallback callback = new HttpResponseSubstitutionCallback(Render); context.Response.WriteSubstitution(callback); } internal string Render(HttpContext context) { // Debug.Assert(_adRotatorHelper != null && _adRotatorHelper.Page != null); // In PostCache Substitution, we use a string writer to return the markup. StringWriter stringWriter = new StringWriter(CultureInfo.CurrentCulture); HtmlTextWriter htmlWriter = _adRotatorHelper.Page.CreateHtmlTextWriter(stringWriter); Debug.Assert(htmlWriter != null); _adRotatorHelper.RenderControl(htmlWriter); // Dump the content out as needed for post-cache substitution. return stringWriter.ToString(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LinqDataSourceValidationException.cs
- DependencyObjectProvider.cs
- HttpPostLocalhostServerProtocol.cs
- InitializeCorrelation.cs
- WmfPlaceableFileHeader.cs
- CompoundFileStreamReference.cs
- DbTransaction.cs
- InputProviderSite.cs
- CachingHintValidation.cs
- NetWebProxyFinder.cs
- HostProtectionException.cs
- ScrollEvent.cs
- XmlAnyElementAttributes.cs
- TextDecorationCollection.cs
- BufferModesCollection.cs
- Control.cs
- SqlParameter.cs
- CodeMemberField.cs
- ReadOnlyDictionary.cs
- CommandConverter.cs
- LocalizableAttribute.cs
- OleCmdHelper.cs
- UIElementParagraph.cs
- DataServiceEntityAttribute.cs
- WithParamAction.cs
- XsltArgumentList.cs
- FileStream.cs
- EmptyTextWriter.cs
- TypeLibConverter.cs
- StreamUpgradeInitiator.cs
- StopRoutingHandler.cs
- ToolboxDataAttribute.cs
- TableDetailsRow.cs
- ExtractorMetadata.cs
- PointLightBase.cs
- EmbeddedMailObject.cs
- ClusterUtils.cs
- ColorAnimationBase.cs
- XmlDataSourceNodeDescriptor.cs
- AbstractExpressions.cs
- GroupBoxDesigner.cs
- HttpContext.cs
- LineGeometry.cs
- AssemblyResourceLoader.cs
- UncommonField.cs
- LinkLabel.cs
- ListControl.cs
- ChangesetResponse.cs
- StylusTip.cs
- PageParser.cs
- RectAnimationBase.cs
- DataErrorValidationRule.cs
- MarkupObject.cs
- FormatterServicesNoSerializableCheck.cs
- DrawingContextDrawingContextWalker.cs
- Descriptor.cs
- XmlRawWriter.cs
- FormViewPageEventArgs.cs
- DefaultPropertyAttribute.cs
- OdbcConnectionPoolProviderInfo.cs
- SqlComparer.cs
- SerialPort.cs
- DesignerInterfaces.cs
- FlowDocumentView.cs
- IPEndPoint.cs
- CharConverter.cs
- WorkflowApplicationTerminatedException.cs
- TypefaceMap.cs
- XmlDataLoader.cs
- SessionStateModule.cs
- HtmlFormParameterReader.cs
- SymLanguageType.cs
- MemberNameValidator.cs
- StateChangeEvent.cs
- BypassElementCollection.cs
- FilterException.cs
- WebPartConnectionsCancelEventArgs.cs
- HitTestParameters.cs
- StreamReader.cs
- PopOutPanel.cs
- InheritanceRules.cs
- OSFeature.cs
- WebService.cs
- SerialPinChanges.cs
- WriteableBitmap.cs
- CharacterHit.cs
- AtomMaterializerLog.cs
- Statements.cs
- CopyCodeAction.cs
- shaperfactory.cs
- ClientFormsIdentity.cs
- XamlReaderConstants.cs
- CacheHelper.cs
- KeyPullup.cs
- ImageAttributes.cs
- HtmlInputCheckBox.cs
- Stream.cs
- PingReply.cs
- TdsParserSessionPool.cs
- CompilerErrorCollection.cs