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
- SmiRecordBuffer.cs
- DebugView.cs
- DbTransaction.cs
- GenericAuthenticationEventArgs.cs
- MediaTimeline.cs
- StaticResourceExtension.cs
- QilSortKey.cs
- PolygonHotSpot.cs
- TrustLevelCollection.cs
- TextTreeRootNode.cs
- CapabilitiesPattern.cs
- NativeRecognizer.cs
- OdbcConnectionOpen.cs
- Content.cs
- KeyValuePair.cs
- ToolStripSystemRenderer.cs
- SimpleHandlerFactory.cs
- DynamicRendererThreadManager.cs
- XmlStreamNodeWriter.cs
- LoginView.cs
- TypeElementCollection.cs
- BaseValidatorDesigner.cs
- _ChunkParse.cs
- SqlDataSourceFilteringEventArgs.cs
- Merger.cs
- SerialStream.cs
- WebPartEditorOkVerb.cs
- SymbolResolver.cs
- IPAddressCollection.cs
- PathTooLongException.cs
- HMACMD5.cs
- SubclassTypeValidator.cs
- ImageDrawing.cs
- CustomError.cs
- DbConvert.cs
- SafeRegistryKey.cs
- OneOfElement.cs
- NameScope.cs
- Line.cs
- TableDetailsCollection.cs
- DSASignatureFormatter.cs
- LocationSectionRecord.cs
- DataTableTypeConverter.cs
- DoWorkEventArgs.cs
- RelationshipEndMember.cs
- PageTheme.cs
- AttributeQuery.cs
- WebPartManager.cs
- PageParser.cs
- CorrelationRequestContext.cs
- WebPartDisplayModeCancelEventArgs.cs
- ArrayHelper.cs
- ExtenderProvidedPropertyAttribute.cs
- CompiledQueryCacheKey.cs
- URL.cs
- SerializerProvider.cs
- MarkupExtensionReturnTypeAttribute.cs
- StringToken.cs
- Control.cs
- IdleTimeoutMonitor.cs
- TextElementEnumerator.cs
- UriSectionData.cs
- XmlSchemaExporter.cs
- LinkLabel.cs
- RelatedCurrencyManager.cs
- MatrixIndependentAnimationStorage.cs
- Substitution.cs
- DelegatingConfigHost.cs
- SafePEFileHandle.cs
- BindToObject.cs
- FormatterServices.cs
- XmlSchemaGroupRef.cs
- XmlDataProvider.cs
- FillErrorEventArgs.cs
- PageRequestManager.cs
- WebPartManagerInternals.cs
- ReferencedType.cs
- TextCompositionEventArgs.cs
- XmlSchemaInclude.cs
- TextTreeFixupNode.cs
- ASCIIEncoding.cs
- Serializer.cs
- WebPartZoneBase.cs
- EntityCommandCompilationException.cs
- MethodBody.cs
- ComUdtElement.cs
- validationstate.cs
- TargetException.cs
- XsdBuilder.cs
- WebHeaderCollection.cs
- Freezable.cs
- CommandEventArgs.cs
- SafeLibraryHandle.cs
- FragmentQueryKB.cs
- DBAsyncResult.cs
- DataRelationPropertyDescriptor.cs
- EventEntry.cs
- BamlResourceSerializer.cs
- DetailsViewDeletedEventArgs.cs
- GridViewUpdateEventArgs.cs