Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / AdPostCacheSubstitution.cs / 2 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpApplicationFactory.cs
- _CookieModule.cs
- LinqDataSourceStatusEventArgs.cs
- DebuggerService.cs
- DependencyPropertyConverter.cs
- XmlSchemas.cs
- DataGridRow.cs
- TableItemPattern.cs
- XpsImageSerializationService.cs
- ContractUtils.cs
- ChtmlCalendarAdapter.cs
- TextSelectionHighlightLayer.cs
- XmlBindingWorker.cs
- DbMetaDataColumnNames.cs
- DecodeHelper.cs
- TdsParameterSetter.cs
- MarkupExtensionReturnTypeAttribute.cs
- XmlSerializerVersionAttribute.cs
- TransformCollection.cs
- FixedPageAutomationPeer.cs
- KeyTimeConverter.cs
- EventQueueState.cs
- Convert.cs
- SchemaRegistration.cs
- FirstMatchCodeGroup.cs
- BitmapData.cs
- SharedDp.cs
- COM2ComponentEditor.cs
- DesignerDataSchemaClass.cs
- URIFormatException.cs
- SendSecurityHeader.cs
- XmlQueryStaticData.cs
- WmlCalendarAdapter.cs
- ConfigurationSectionHelper.cs
- RelatedView.cs
- GeometryModel3D.cs
- HttpConfigurationSystem.cs
- BitHelper.cs
- CodeDomSerializationProvider.cs
- UnsafeNativeMethodsPenimc.cs
- Matrix.cs
- CodeExporter.cs
- AssemblyBuilderData.cs
- HitTestWithPointDrawingContextWalker.cs
- HtmlTableCell.cs
- RawStylusInputCustomData.cs
- DebugHandleTracker.cs
- PagedControl.cs
- KerberosSecurityTokenProvider.cs
- CompositeControl.cs
- LazyLoadBehavior.cs
- BitmapFrameEncode.cs
- OracleSqlParser.cs
- CookielessHelper.cs
- FileNotFoundException.cs
- DomainConstraint.cs
- NullableConverter.cs
- LocationEnvironment.cs
- ListControl.cs
- SchemaObjectWriter.cs
- BamlLocalizableResource.cs
- CachedPathData.cs
- MetabaseServerConfig.cs
- BrowsableAttribute.cs
- PropertySegmentSerializationProvider.cs
- DocumentPageView.cs
- ProfileGroupSettings.cs
- EnumConverter.cs
- PersonalizationDictionary.cs
- InvalidPipelineStoreException.cs
- MDIClient.cs
- EntryPointNotFoundException.cs
- ByteStreamGeometryContext.cs
- VerifyHashRequest.cs
- Matrix.cs
- SessionEndingCancelEventArgs.cs
- CalculatedColumn.cs
- LocatorPartList.cs
- WebPartPersonalization.cs
- UInt64Converter.cs
- TextEncodedRawTextWriter.cs
- Sql8ExpressionRewriter.cs
- MemberAccessException.cs
- _ListenerAsyncResult.cs
- WebPartsPersonalization.cs
- TraceData.cs
- SQLBytesStorage.cs
- FlowPosition.cs
- Codec.cs
- DateTimeUtil.cs
- SQLChars.cs
- SQLBytes.cs
- ControlsConfig.cs
- HtmlElementEventArgs.cs
- ToolStripContainerActionList.cs
- TypedReference.cs
- SafeHandles.cs
- Paragraph.cs
- HelpInfo.cs
- DesignColumnCollection.cs