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
- PhonemeConverter.cs
- UrlMappingsModule.cs
- RelatedImageListAttribute.cs
- PersonalizationProviderHelper.cs
- DataSourceExpression.cs
- PipelineModuleStepContainer.cs
- PartialClassGenerationTask.cs
- Executor.cs
- XPathNodeIterator.cs
- HttpListenerPrefixCollection.cs
- TaskFileService.cs
- TemplatedAdorner.cs
- AssemblyResourceLoader.cs
- ComplexObject.cs
- AssemblyResourceLoader.cs
- PersonalizablePropertyEntry.cs
- COM2PropertyDescriptor.cs
- ToolStrip.cs
- GeometryCombineModeValidation.cs
- CompareInfo.cs
- MethodSet.cs
- CannotUnloadAppDomainException.cs
- Stack.cs
- ComponentDispatcher.cs
- BaseCodeDomTreeGenerator.cs
- COAUTHIDENTITY.cs
- StorageMappingItemCollection.cs
- Hash.cs
- TreeChangeInfo.cs
- DesignerDataTableBase.cs
- Document.cs
- MimeAnyImporter.cs
- DefaultWorkflowLoaderService.cs
- Material.cs
- EncoderExceptionFallback.cs
- XmlNamespaceDeclarationsAttribute.cs
- FileDialog.cs
- GridViewActionList.cs
- Repeater.cs
- QualifierSet.cs
- BitVector32.cs
- InfoCardSymmetricAlgorithm.cs
- PeerToPeerException.cs
- TreeViewCancelEvent.cs
- HttpPostedFile.cs
- XmlWriterSettings.cs
- BamlLocalizationDictionary.cs
- ProofTokenCryptoHandle.cs
- XhtmlBasicPhoneCallAdapter.cs
- CoreSwitches.cs
- ValueChangedEventManager.cs
- XmlTextEncoder.cs
- WaveHeader.cs
- SQLMoney.cs
- MimeParameterWriter.cs
- SatelliteContractVersionAttribute.cs
- Separator.cs
- ThemeDirectoryCompiler.cs
- ASCIIEncoding.cs
- XmlWrappingReader.cs
- ChangePassword.cs
- PeerEndPoint.cs
- WrapPanel.cs
- DateTimeOffsetStorage.cs
- RequestCacheValidator.cs
- DrawingServices.cs
- DefaultPropertyAttribute.cs
- CodeVariableDeclarationStatement.cs
- CommandLineParser.cs
- SwitchAttribute.cs
- HttpDebugHandler.cs
- TableCellCollection.cs
- HMACSHA384.cs
- PopupRootAutomationPeer.cs
- PointLight.cs
- DbDeleteCommandTree.cs
- Oid.cs
- TextEvent.cs
- _ChunkParse.cs
- Ops.cs
- TextInfo.cs
- RequiredFieldValidator.cs
- BaseTemplatedMobileComponentEditor.cs
- SchemaImporterExtensionElement.cs
- BaseDataBoundControlDesigner.cs
- TraceSection.cs
- RootBrowserWindowProxy.cs
- TableSectionStyle.cs
- RC2.cs
- GridViewRowPresenterBase.cs
- XsdBuildProvider.cs
- ThreadExceptionEvent.cs
- ServiceElementCollection.cs
- safesecurityhelperavalon.cs
- ClientTarget.cs
- DictionaryBase.cs
- FilterEventArgs.cs
- BinaryWriter.cs
- Certificate.cs
- BindingValueChangedEventArgs.cs