Code:
/ FX-1434 / FX-1434 / 1.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
- InstallerTypeAttribute.cs
- SessionPageStatePersister.cs
- XmlQuerySequence.cs
- TransformerTypeCollection.cs
- LostFocusEventManager.cs
- MobileControlDesigner.cs
- SimpleFileLog.cs
- Parameter.cs
- PropertyEmitterBase.cs
- SplitContainerDesigner.cs
- Boolean.cs
- XmlComment.cs
- AssertSection.cs
- ModelVisual3D.cs
- BCLDebug.cs
- Atom10FormatterFactory.cs
- PartialCachingAttribute.cs
- CatalogUtil.cs
- ConstNode.cs
- Variable.cs
- Transform.cs
- Receive.cs
- WindowsListViewItemCheckBox.cs
- Calendar.cs
- PrintingPermission.cs
- SignedInfo.cs
- ImageMap.cs
- Attributes.cs
- PointConverter.cs
- XmlSchemaValidator.cs
- ThreadAttributes.cs
- ConstraintManager.cs
- TemplateAction.cs
- DefaultWorkflowLoaderService.cs
- SQLGuidStorage.cs
- XmlValidatingReaderImpl.cs
- DrawingVisual.cs
- FormViewInsertEventArgs.cs
- RegisteredExpandoAttribute.cs
- smtpconnection.cs
- CodeRemoveEventStatement.cs
- ObjectAnimationBase.cs
- ApplicationContext.cs
- TextDecoration.cs
- SecurityTokenValidationException.cs
- ResourcesChangeInfo.cs
- Pointer.cs
- ConfigurationFileMap.cs
- Set.cs
- DbConnectionHelper.cs
- QualificationDataAttribute.cs
- LocationSectionRecord.cs
- ByteArrayHelperWithString.cs
- IndicShape.cs
- RubberbandSelector.cs
- CharEnumerator.cs
- assertwrapper.cs
- PrintPreviewDialog.cs
- XmlSerializationWriter.cs
- PrinterUnitConvert.cs
- ErrorsHelper.cs
- IgnoreFlushAndCloseStream.cs
- FileSystemEnumerable.cs
- EllipseGeometry.cs
- ClassImporter.cs
- Pair.cs
- EpmSyndicationContentSerializer.cs
- arabicshape.cs
- EdmFunctionAttribute.cs
- SudsCommon.cs
- SQLBoolean.cs
- PointAnimationUsingPath.cs
- ReachUIElementCollectionSerializerAsync.cs
- TextModifier.cs
- ContextMenuService.cs
- ToolStripPanelRenderEventArgs.cs
- Html32TextWriter.cs
- CacheVirtualItemsEvent.cs
- TCPClient.cs
- ConfigLoader.cs
- JsonSerializer.cs
- DeploymentSectionCache.cs
- AsmxEndpointPickerExtension.cs
- DataGridViewColumnEventArgs.cs
- SelectionChangedEventArgs.cs
- GenericAuthenticationEventArgs.cs
- EventDescriptor.cs
- _ListenerRequestStream.cs
- ToolStripPanelCell.cs
- SiteOfOriginContainer.cs
- LineInfo.cs
- UIElementCollection.cs
- Vector3DCollection.cs
- OleDbTransaction.cs
- WebPartTransformer.cs
- DebuggerAttributes.cs
- MessageQueue.cs
- EastAsianLunisolarCalendar.cs
- CountAggregationOperator.cs
- PointHitTestParameters.cs