Code:
/ DotNET / DotNET / 8.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
- ModifierKeysValueSerializer.cs
- XmlSerializerOperationGenerator.cs
- InstalledVoice.cs
- ClosableStream.cs
- EditableRegion.cs
- IndicFontClient.cs
- OutputWindow.cs
- DataException.cs
- SqlDataSourceView.cs
- LineServices.cs
- StringSource.cs
- PtsHelper.cs
- UInt64Storage.cs
- ItemTypeToolStripMenuItem.cs
- TextPointerBase.cs
- View.cs
- GestureRecognizer.cs
- WpfGeneratedKnownProperties.cs
- DataTableCollection.cs
- WebSysDefaultValueAttribute.cs
- OracleDataReader.cs
- HttpWebRequest.cs
- SafeThreadHandle.cs
- DataBoundControl.cs
- ParenExpr.cs
- RequestQueryProcessor.cs
- ThreadPool.cs
- DateTimeSerializationSection.cs
- Rules.cs
- HandleRef.cs
- CursorConverter.cs
- SessionStateUtil.cs
- TrailingSpaceComparer.cs
- EdmComplexPropertyAttribute.cs
- RestClientProxyHandler.cs
- WebPartEditorCancelVerb.cs
- SapiRecognizer.cs
- HtmlSelectionListAdapter.cs
- DoubleConverter.cs
- SecureEnvironment.cs
- ExceptionList.cs
- ContentFileHelper.cs
- X509Utils.cs
- PrivilegeNotHeldException.cs
- ProfileProvider.cs
- TreeNodeCollection.cs
- XmlSerializerNamespaces.cs
- EntityTypeBase.cs
- CustomError.cs
- ActivationArguments.cs
- ProcessManager.cs
- MachineKeyConverter.cs
- XamlStream.cs
- ClientSession.cs
- ConnectionPoolManager.cs
- CollectionViewSource.cs
- ScriptServiceAttribute.cs
- MailBnfHelper.cs
- SchemaHelper.cs
- SqlUtils.cs
- PrePrepareMethodAttribute.cs
- HtmlInputControl.cs
- DataPagerFieldItem.cs
- AnonymousIdentificationSection.cs
- XmlDictionaryWriter.cs
- ManagementOperationWatcher.cs
- RemoteWebConfigurationHost.cs
- SqlUDTStorage.cs
- Ops.cs
- GenericTextProperties.cs
- ScriptReferenceEventArgs.cs
- ComEventsMethod.cs
- EventSetter.cs
- XhtmlConformanceSection.cs
- FileUpload.cs
- SignatureToken.cs
- SynchronizingStream.cs
- RemoteCryptoTokenProvider.cs
- Annotation.cs
- QueryRewriter.cs
- WinEventHandler.cs
- DependencyPropertyHelper.cs
- GlyphCache.cs
- TextTreeExtractElementUndoUnit.cs
- CngProvider.cs
- IPPacketInformation.cs
- ExchangeUtilities.cs
- CallTemplateAction.cs
- RegexRunnerFactory.cs
- CodeFieldReferenceExpression.cs
- XmlElementAttributes.cs
- LocationInfo.cs
- DataColumnPropertyDescriptor.cs
- StringFormat.cs
- XmlAttributeOverrides.cs
- TokenizerHelper.cs
- ListChangedEventArgs.cs
- DataComponentMethodGenerator.cs
- tibetanshape.cs
- SiteMapNodeItem.cs