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
- TreeNodeBinding.cs
- Event.cs
- ErrorTolerantObjectWriter.cs
- TypeTypeConverter.cs
- SimpleFieldTemplateUserControl.cs
- QuaternionAnimationUsingKeyFrames.cs
- SortedDictionary.cs
- ReferentialConstraint.cs
- SchemaElementLookUpTable.cs
- DataGridTextBoxColumn.cs
- ActiveXHost.cs
- NeutralResourcesLanguageAttribute.cs
- CategoryValueConverter.cs
- BlockUIContainer.cs
- XPathDocumentIterator.cs
- MonitoringDescriptionAttribute.cs
- VerificationException.cs
- EditorPart.cs
- TreeViewImageKeyConverter.cs
- PersistenceTypeAttribute.cs
- DataError.cs
- HttpValueCollection.cs
- PropertyMap.cs
- HtmlLink.cs
- TabControl.cs
- EncoderParameter.cs
- WindowsTitleBar.cs
- CallSiteHelpers.cs
- EventRouteFactory.cs
- XmlSchemaInfo.cs
- PropertyItem.cs
- XmlDataDocument.cs
- SerializerProvider.cs
- BamlResourceSerializer.cs
- PersonalizableTypeEntry.cs
- EmbeddedObject.cs
- AspProxy.cs
- SqlParameter.cs
- ControlPager.cs
- HtmlHead.cs
- DocumentViewerHelper.cs
- PolicyReader.cs
- RuntimeWrappedException.cs
- GeometryValueSerializer.cs
- OdbcRowUpdatingEvent.cs
- TrackingProfileCache.cs
- XPathBinder.cs
- EllipseGeometry.cs
- DesignBindingEditor.cs
- WindowsContainer.cs
- Menu.cs
- ViewManager.cs
- BuildResultCache.cs
- HttpHandlerActionCollection.cs
- SHA512Managed.cs
- Utility.cs
- MimeReflector.cs
- PkcsMisc.cs
- SymbolType.cs
- RestHandlerFactory.cs
- DebugHandleTracker.cs
- LocalBuilder.cs
- DataBoundControlAdapter.cs
- DuplexSecurityProtocolFactory.cs
- TextEditorSelection.cs
- CodeTryCatchFinallyStatement.cs
- PersistStreamTypeWrapper.cs
- GenericTypeParameterBuilder.cs
- TextSelectionHighlightLayer.cs
- TextPointer.cs
- AttachInfo.cs
- XmlILTrace.cs
- SocketInformation.cs
- ThreadStateException.cs
- ReferencedAssembly.cs
- PEFileEvidenceFactory.cs
- TreeViewImageKeyConverter.cs
- NegotiationTokenProvider.cs
- CacheEntry.cs
- Track.cs
- SystemIPv6InterfaceProperties.cs
- IntegerFacetDescriptionElement.cs
- EditorZone.cs
- CmsInterop.cs
- WindowsScroll.cs
- XmlUtil.cs
- PenThreadPool.cs
- InvokeBase.cs
- DataServiceContext.cs
- FormsAuthenticationModule.cs
- LocatorBase.cs
- MethodResolver.cs
- SourceFileInfo.cs
- AttachedPropertyDescriptor.cs
- HealthMonitoringSection.cs
- _BasicClient.cs
- LightweightCodeGenerator.cs
- HttpNamespaceReservationInstallComponent.cs
- DesignerValidationSummaryAdapter.cs
- RC2.cs