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
- InvokePatternIdentifiers.cs
- TypeForwardedToAttribute.cs
- LineGeometry.cs
- XmlDataSourceNodeDescriptor.cs
- Matrix3DConverter.cs
- DCSafeHandle.cs
- MetadataArtifactLoaderCompositeFile.cs
- WebPartVerbCollection.cs
- FolderLevelBuildProviderCollection.cs
- TimeIntervalCollection.cs
- ApplicationInfo.cs
- RsaKeyIdentifierClause.cs
- MaskedTextBox.cs
- Keyboard.cs
- SizeConverter.cs
- Decorator.cs
- UpdatePanel.cs
- XPathParser.cs
- Util.cs
- OleDbRowUpdatingEvent.cs
- GPStream.cs
- PeerApplication.cs
- LocalizationComments.cs
- Link.cs
- safex509handles.cs
- EntityContainerAssociationSet.cs
- SettingsPropertyValue.cs
- RuntimeCompatibilityAttribute.cs
- EncryptedData.cs
- PassportAuthenticationEventArgs.cs
- JoinElimination.cs
- Nullable.cs
- COM2ExtendedUITypeEditor.cs
- SchemaImporterExtension.cs
- OpenFileDialog.cs
- ValueExpressions.cs
- RelationshipConverter.cs
- ZipPackage.cs
- CopyAttributesAction.cs
- ClientTargetSection.cs
- InkPresenterAutomationPeer.cs
- DataRow.cs
- Menu.cs
- SerializationSectionGroup.cs
- ListViewCancelEventArgs.cs
- errorpatternmatcher.cs
- PhonemeConverter.cs
- SecurityContextSecurityTokenParameters.cs
- PassportAuthenticationModule.cs
- UrlPath.cs
- ValueExpressions.cs
- TemplateParser.cs
- DataPagerCommandEventArgs.cs
- CodeExpressionStatement.cs
- SqlDuplicator.cs
- TextPattern.cs
- compensatingcollection.cs
- ToolboxDataAttribute.cs
- Command.cs
- MarginsConverter.cs
- IntegerFacetDescriptionElement.cs
- ConnectionPoint.cs
- SourceInterpreter.cs
- MenuRendererClassic.cs
- SqlProcedureAttribute.cs
- ConnectionStringsExpressionBuilder.cs
- WriterOutput.cs
- DataControlFieldHeaderCell.cs
- DesignerAdapterUtil.cs
- ZipIOExtraFieldZip64Element.cs
- HwndTarget.cs
- SoundPlayer.cs
- FactoryGenerator.cs
- FlagsAttribute.cs
- DocumentPage.cs
- TeredoHelper.cs
- COSERVERINFO.cs
- ClientProxyGenerator.cs
- TimelineCollection.cs
- CustomMenuItemCollection.cs
- TreeNodeCollection.cs
- RegistrationServices.cs
- DataGridViewColumnCollectionDialog.cs
- PrintPreviewControl.cs
- KeyGestureValueSerializer.cs
- UpdatePanel.cs
- SmiTypedGetterSetter.cs
- XmlElement.cs
- Crypto.cs
- baseaxisquery.cs
- DiscoveryMessageSequence11.cs
- FileVersionInfo.cs
- ZoneLinkButton.cs
- PublishLicense.cs
- BindingNavigator.cs
- WrappedKeySecurityTokenParameters.cs
- messageonlyhwndwrapper.cs
- SessionPageStatePersister.cs
- DbProviderFactory.cs
- CodeTypeReference.cs