Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / AdPostCacheSubstitution.cs / 1305376 / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetafileHeaderWmf.cs
- KeyEvent.cs
- AutoGeneratedField.cs
- EventRoute.cs
- ClientRuntimeConfig.cs
- StandardBindingOptionalReliableSessionElement.cs
- BitmapCodecInfo.cs
- AutomationIdentifierGuids.cs
- HitTestResult.cs
- ListViewItemSelectionChangedEvent.cs
- NativeRightsManagementAPIsStructures.cs
- PrintingPermissionAttribute.cs
- FixedSOMElement.cs
- EdmItemCollection.cs
- _ScatterGatherBuffers.cs
- DataGridLinkButton.cs
- SystemIPInterfaceProperties.cs
- TextFormatterHost.cs
- QueryReaderSettings.cs
- Section.cs
- XmlHierarchicalEnumerable.cs
- BitmapDownload.cs
- MemoryStream.cs
- ArithmeticException.cs
- DSACryptoServiceProvider.cs
- WebFormDesignerActionService.cs
- XmlNavigatorStack.cs
- ControlPaint.cs
- SatelliteContractVersionAttribute.cs
- wgx_sdk_version.cs
- Floater.cs
- FusionWrap.cs
- ConfigurationManagerHelperFactory.cs
- PrintingPermissionAttribute.cs
- ProxyAssemblyNotLoadedException.cs
- OutputScopeManager.cs
- GeometryModel3D.cs
- Merger.cs
- UserMapPath.cs
- WebResponse.cs
- GenericsInstances.cs
- SiteMapNode.cs
- SupportsPreviewControlAttribute.cs
- DesignerRegionCollection.cs
- NetworkInformationPermission.cs
- StickyNoteHelper.cs
- DesignerContextDescriptor.cs
- StorageSetMapping.cs
- querybuilder.cs
- Scripts.cs
- DataGridDesigner.cs
- IDispatchConstantAttribute.cs
- CodeSubDirectoriesCollection.cs
- PathFigureCollectionConverter.cs
- ServiceNameElementCollection.cs
- WindowsRegion.cs
- LassoHelper.cs
- CodeBlockBuilder.cs
- UnicodeEncoding.cs
- AcceleratedTokenProvider.cs
- BindableAttribute.cs
- ResourceAttributes.cs
- SqlUserDefinedAggregateAttribute.cs
- HandleCollector.cs
- SchemaHelper.cs
- DataGridAutoFormat.cs
- FilterQuery.cs
- GroupBoxRenderer.cs
- StandardToolWindows.cs
- ImageCreator.cs
- TableLayoutSettings.cs
- RelatedCurrencyManager.cs
- XmlSchemaObjectTable.cs
- ToolStripGrip.cs
- Catch.cs
- WebZoneDesigner.cs
- Help.cs
- XNodeNavigator.cs
- CodeStatement.cs
- BinaryObjectReader.cs
- PtsHelper.cs
- CacheEntry.cs
- HitTestParameters3D.cs
- FileStream.cs
- _OverlappedAsyncResult.cs
- RangeValuePattern.cs
- WorkflowMarkupSerializer.cs
- MediaCommands.cs
- ObjectItemCachedAssemblyLoader.cs
- ScriptModule.cs
- SHA384Managed.cs
- LockRecoveryTask.cs
- PeerNameRegistration.cs
- DataKeyCollection.cs
- WCFBuildProvider.cs
- DesignerVerb.cs
- GridViewDeleteEventArgs.cs
- DeploymentSection.cs
- CalendarDayButton.cs
- XmlAttribute.cs