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
- UriTemplateDispatchFormatter.cs
- FileLogRecord.cs
- Guid.cs
- LinearGradientBrush.cs
- linebase.cs
- AccessDataSourceView.cs
- DbExpressionVisitor.cs
- dataSvcMapFileLoader.cs
- OutputCacheProfile.cs
- SMSvcHost.cs
- SmiEventStream.cs
- TranslateTransform.cs
- DataContractAttribute.cs
- WindowsClaimSet.cs
- SourceChangedEventArgs.cs
- ToolboxItemCollection.cs
- SmiMetaDataProperty.cs
- DataTable.cs
- PrimitiveRenderer.cs
- FormViewModeEventArgs.cs
- StringConverter.cs
- InputLanguageProfileNotifySink.cs
- ProcessProtocolHandler.cs
- KeyMatchBuilder.cs
- HtmlInputPassword.cs
- NegatedConstant.cs
- Enum.cs
- TimeManager.cs
- ValidationResult.cs
- PartialClassGenerationTaskInternal.cs
- DataListItemCollection.cs
- DataGridViewCellEventArgs.cs
- DataPagerFieldItem.cs
- DynamicResourceExtension.cs
- MimeObjectFactory.cs
- MimeMultiPart.cs
- TypeDescriptorFilterService.cs
- AbsoluteQuery.cs
- ExpressionsCollectionConverter.cs
- CleanUpVirtualizedItemEventArgs.cs
- ComponentCommands.cs
- EdmTypeAttribute.cs
- ReachPrintTicketSerializer.cs
- ForeignConstraint.cs
- AlgoModule.cs
- XhtmlBasicTextBoxAdapter.cs
- FixedSOMFixedBlock.cs
- AxisAngleRotation3D.cs
- UnsafeNativeMethods.cs
- AutomationIdentifier.cs
- XPathNodeHelper.cs
- VisualBrush.cs
- MutexSecurity.cs
- OciEnlistContext.cs
- AutomationPeer.cs
- HandleTable.cs
- Debug.cs
- Int64Storage.cs
- PathStreamGeometryContext.cs
- DataObjectMethodAttribute.cs
- SignatureHelper.cs
- PackageFilter.cs
- COM2IDispatchConverter.cs
- Semaphore.cs
- WorkflowItemsPresenter.cs
- WindowsAuthenticationEventArgs.cs
- GB18030Encoding.cs
- RemotingAttributes.cs
- DetailsViewRow.cs
- GuidConverter.cs
- DesignerLabelAdapter.cs
- VectorAnimationUsingKeyFrames.cs
- ParameterCollection.cs
- PropertyStore.cs
- PlainXmlSerializer.cs
- UInt64.cs
- InitializationEventAttribute.cs
- SQLDateTime.cs
- WCFBuildProvider.cs
- PartBasedPackageProperties.cs
- AnimationException.cs
- Site.cs
- SqlTransaction.cs
- ProgressPage.cs
- SQLString.cs
- NonVisualControlAttribute.cs
- FlowPosition.cs
- PackagingUtilities.cs
- BitmapFrameDecode.cs
- EdmConstants.cs
- SqlFormatter.cs
- IntermediatePolicyValidator.cs
- AppearanceEditorPart.cs
- SqlDataSourceView.cs
- HtmlUtf8RawTextWriter.cs
- CompilerResults.cs
- TextDecoration.cs
- PointAnimationUsingKeyFrames.cs
- WebPageTraceListener.cs
- XmlSerializationGeneratedCode.cs