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
- WorkflowRuntimeElement.cs
- EntityContainerEmitter.cs
- __ConsoleStream.cs
- ExpressionConverter.cs
- PartialCachingAttribute.cs
- DragStartedEventArgs.cs
- CellTreeNode.cs
- PeerNameRecord.cs
- QilScopedVisitor.cs
- GeometryConverter.cs
- SqlCacheDependencySection.cs
- AppDomainUnloadedException.cs
- DefaultPropertiesToSend.cs
- ObjectManager.cs
- WmlTextViewAdapter.cs
- SiteMapHierarchicalDataSourceView.cs
- WebPartAddingEventArgs.cs
- LinqTreeNodeEvaluator.cs
- CurrentChangedEventManager.cs
- SizeAnimation.cs
- SerializationIncompleteException.cs
- PackageDigitalSignature.cs
- OdbcException.cs
- WebPartHeaderCloseVerb.cs
- XmlSchemaExternal.cs
- Ticks.cs
- BitmapMetadataEnumerator.cs
- WindowsScroll.cs
- SelectorAutomationPeer.cs
- EventMap.cs
- DataControlButton.cs
- CounterNameConverter.cs
- RuntimeHelpers.cs
- SqlBulkCopy.cs
- ToolBarDesigner.cs
- Highlights.cs
- SmtpCommands.cs
- XdrBuilder.cs
- SocketElement.cs
- IssuedSecurityTokenParameters.cs
- XmlTypeMapping.cs
- ObjectKeyFrameCollection.cs
- WebServiceMethodData.cs
- ObjectAnimationBase.cs
- TimeZone.cs
- SimpleNameService.cs
- CriticalExceptions.cs
- AttachedPropertyMethodSelector.cs
- ConversionValidationRule.cs
- TrustLevelCollection.cs
- TargetException.cs
- InfoCardListRequest.cs
- QilFunction.cs
- EntityTypeEmitter.cs
- Stroke2.cs
- SecurityHelper.cs
- CompatibleComparer.cs
- FtpWebResponse.cs
- AnimationStorage.cs
- ListBindingHelper.cs
- XpsSerializationException.cs
- OleDbSchemaGuid.cs
- RegexTree.cs
- ImageIndexConverter.cs
- CodeSnippetCompileUnit.cs
- FrameDimension.cs
- RepeaterItemEventArgs.cs
- AssemblyAttributesGoHere.cs
- NameValueFileSectionHandler.cs
- FormsAuthenticationConfiguration.cs
- AtomMaterializer.cs
- OutputCacheSection.cs
- SmtpDigestAuthenticationModule.cs
- BamlBinaryReader.cs
- Highlights.cs
- CommandEventArgs.cs
- XmlILCommand.cs
- PreviousTrackingServiceAttribute.cs
- ToolStripDropDownItem.cs
- HashAlgorithm.cs
- TargetException.cs
- EntityDataSourceReferenceGroup.cs
- XmlSerializationWriter.cs
- DefaultAuthorizationContext.cs
- SequenceDesigner.cs
- TransformerInfoCollection.cs
- RemoteWebConfigurationHost.cs
- StylusPointProperties.cs
- DeferredTextReference.cs
- MULTI_QI.cs
- RadioButtonList.cs
- Size3DValueSerializer.cs
- CodeVariableDeclarationStatement.cs
- SiteMapNode.cs
- Subtree.cs
- ColorMap.cs
- AssemblyName.cs
- NameService.cs
- WindowsNonControl.cs
- DoubleLinkListEnumerator.cs