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
- InternalRelationshipCollection.cs
- LayoutTable.cs
- BeginEvent.cs
- TerminatorSinks.cs
- ConnectionPoolRegistry.cs
- IisNotInstalledException.cs
- ListViewGroupConverter.cs
- HideDisabledControlAdapter.cs
- BaseProcessProtocolHandler.cs
- x509store.cs
- UrlPath.cs
- ResXBuildProvider.cs
- WindowsScrollBar.cs
- SeparatorAutomationPeer.cs
- ConfigXmlReader.cs
- WebBrowserPermission.cs
- ResourceContainer.cs
- ComponentCommands.cs
- XmlQualifiedName.cs
- WindowsMenu.cs
- RelatedImageListAttribute.cs
- SoapAttributeOverrides.cs
- AnnotationResourceCollection.cs
- FlowDocumentScrollViewer.cs
- DesignerToolStripControlHost.cs
- Resources.Designer.cs
- WebConfigurationManager.cs
- OverlappedAsyncResult.cs
- MissingManifestResourceException.cs
- BezierSegment.cs
- DesignRelation.cs
- ToolStripRenderer.cs
- DropDownList.cs
- Visual3DCollection.cs
- ReadOnlyDataSourceView.cs
- PasswordPropertyTextAttribute.cs
- HiddenFieldPageStatePersister.cs
- SerializationEventsCache.cs
- MasterPageBuildProvider.cs
- Figure.cs
- ChannelDispatcherBase.cs
- Converter.cs
- DataGridRowEventArgs.cs
- XsltContext.cs
- LongTypeConverter.cs
- StandardCommandToolStripMenuItem.cs
- AvTraceDetails.cs
- IPAddress.cs
- CriticalHandle.cs
- LogStore.cs
- WebBrowserPermission.cs
- PrinterUnitConvert.cs
- XmlTextAttribute.cs
- DataGridPagerStyle.cs
- MergeFilterQuery.cs
- EmptyEnumerable.cs
- MultipartContentParser.cs
- TargetInvocationException.cs
- ListViewItem.cs
- ToolTip.cs
- HttpListenerRequest.cs
- DiscoveryDocumentLinksPattern.cs
- tibetanshape.cs
- GenerateScriptTypeAttribute.cs
- MsmqMessageProperty.cs
- PersonalizationProviderHelper.cs
- CodeMemberField.cs
- Empty.cs
- SchemaInfo.cs
- Barrier.cs
- ManagementObjectCollection.cs
- ToolBar.cs
- JournalEntryStack.cs
- Misc.cs
- PixelFormats.cs
- ParallelSeparator.xaml.cs
- PerformanceCountersElement.cs
- BridgeDataReader.cs
- ListenerSessionConnection.cs
- KeyProperty.cs
- DecoderFallback.cs
- StaticDataManager.cs
- CacheSection.cs
- SendMailErrorEventArgs.cs
- SecurityIdentifierConverter.cs
- _RequestCacheProtocol.cs
- ErrorStyle.cs
- BitmapEffectGroup.cs
- Registry.cs
- ValidatorCollection.cs
- MaskDesignerDialog.cs
- ClientFactory.cs
- CorrelationResolver.cs
- ErrorsHelper.cs
- WindowsListViewGroupSubsetLink.cs
- ColorContextHelper.cs
- Annotation.cs
- HtmlTable.cs
- ResXResourceWriter.cs
- IFlowDocumentViewer.cs