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
- Expr.cs
- FileReservationCollection.cs
- LabelEditEvent.cs
- PageThemeParser.cs
- MonikerUtility.cs
- HttpEncoder.cs
- FlagsAttribute.cs
- HttpListenerRequest.cs
- IntSecurity.cs
- TrailingSpaceComparer.cs
- GeometryDrawing.cs
- ProtocolViolationException.cs
- XmlTextAttribute.cs
- SoapTransportImporter.cs
- LayoutManager.cs
- IncrementalReadDecoders.cs
- ObjectDataSourceWizardForm.cs
- DbMetaDataColumnNames.cs
- COM2PropertyDescriptor.cs
- ProfileManager.cs
- DbParameterCollection.cs
- TextReturnReader.cs
- XmlWhitespace.cs
- RecognitionResult.cs
- PnrpPermission.cs
- JapaneseCalendar.cs
- DictionaryEntry.cs
- messageonlyhwndwrapper.cs
- LocatorBase.cs
- XamlBrushSerializer.cs
- CacheVirtualItemsEvent.cs
- XmlAttributeOverrides.cs
- CryptoApi.cs
- CollectionAdapters.cs
- PartManifestEntry.cs
- DataKey.cs
- ObjectReferenceStack.cs
- AutomationProperties.cs
- Preprocessor.cs
- PlanCompiler.cs
- QuarticEase.cs
- CompilationUtil.cs
- MediaPlayerState.cs
- OrderingInfo.cs
- ActivationArguments.cs
- HandleCollector.cs
- StringBuilder.cs
- InlineObject.cs
- GrammarBuilderBase.cs
- XmlValueConverter.cs
- DbInsertCommandTree.cs
- Track.cs
- LockCookie.cs
- ServiceProviders.cs
- CalculatedColumn.cs
- Ops.cs
- DataGridPageChangedEventArgs.cs
- QuinticEase.cs
- CodeIdentifier.cs
- EnumCodeDomSerializer.cs
- ChtmlMobileTextWriter.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- WebFormDesignerActionService.cs
- Range.cs
- ClientConvert.cs
- InfoCardSymmetricCrypto.cs
- NativeMethodsCLR.cs
- SdlChannelSink.cs
- DataExpression.cs
- ObjectDataSourceMethodEventArgs.cs
- ArglessEventHandlerProxy.cs
- BidPrivateBase.cs
- BitStack.cs
- EditorZoneBase.cs
- PerfProviderCollection.cs
- IndexOutOfRangeException.cs
- VariableModifiersHelper.cs
- LoadGrammarCompletedEventArgs.cs
- ObjectManager.cs
- SemanticBasicElement.cs
- BindingExpressionUncommonField.cs
- XsltFunctions.cs
- EmbeddedMailObject.cs
- RuleSettings.cs
- EpmContentSerializerBase.cs
- TraceListeners.cs
- UITypeEditor.cs
- HtmlInputText.cs
- DispatcherTimer.cs
- GorillaCodec.cs
- NativeWindow.cs
- WorkflowRuntimeSection.cs
- OleCmdHelper.cs
- MessageSecurityTokenVersion.cs
- ObjectTag.cs
- ParserStreamGeometryContext.cs
- RecordBuilder.cs
- IxmlLineInfo.cs
- FormViewCommandEventArgs.cs
- SplayTreeNode.cs