Code:
/ FX-1434 / FX-1434 / 1.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
- GACMembershipCondition.cs
- XmlWrappingWriter.cs
- XmlSchemaSimpleContentExtension.cs
- HtmlWindow.cs
- TreeNode.cs
- RegisteredDisposeScript.cs
- MatrixAnimationUsingPath.cs
- RangeValidator.cs
- CollectionConverter.cs
- ChangeNode.cs
- CompressedStack.cs
- TypedDataSourceCodeGenerator.cs
- TextPointer.cs
- CharConverter.cs
- ClientCultureInfo.cs
- ToolStripMenuItemCodeDomSerializer.cs
- UserPersonalizationStateInfo.cs
- Interfaces.cs
- ApplicationActivator.cs
- CodeDelegateCreateExpression.cs
- Missing.cs
- UnsafeNativeMethods.cs
- DispatcherHooks.cs
- ListBoxItemAutomationPeer.cs
- QilGenerator.cs
- CalendarDay.cs
- WebSysDisplayNameAttribute.cs
- ManagementBaseObject.cs
- TouchDevice.cs
- Operand.cs
- path.cs
- BeginStoryboard.cs
- LinqDataSourceHelper.cs
- BaseValidator.cs
- DataSourceCacheDurationConverter.cs
- MulticastOption.cs
- ProbeDuplexAsyncResult.cs
- UrlAuthFailedErrorFormatter.cs
- ListBoxAutomationPeer.cs
- FileVersionInfo.cs
- DeobfuscatingStream.cs
- XsltLoader.cs
- ManagementEventWatcher.cs
- CodeCommentStatement.cs
- SettingsAttributeDictionary.cs
- SuppressMergeCheckAttribute.cs
- ButtonColumn.cs
- SynchronizedDispatch.cs
- RelationshipSet.cs
- RuntimeCompatibilityAttribute.cs
- StyleSelector.cs
- DefaultEventAttribute.cs
- ForeignConstraint.cs
- cookiecollection.cs
- ObfuscateAssemblyAttribute.cs
- FontNameConverter.cs
- XXXOnTypeBuilderInstantiation.cs
- CodeTypeParameterCollection.cs
- PeerNearMe.cs
- KeyValuePairs.cs
- DownloadProgressEventArgs.cs
- SQLCharsStorage.cs
- AssertSection.cs
- AttributeXamlType.cs
- DependencyObject.cs
- DispatchProxy.cs
- QueryOperator.cs
- DataGridLinkButton.cs
- Multiply.cs
- ThicknessAnimationBase.cs
- DelegatingTypeDescriptionProvider.cs
- ValidationErrorEventArgs.cs
- AndCondition.cs
- _SSPISessionCache.cs
- FixedPageAutomationPeer.cs
- GetPageNumberCompletedEventArgs.cs
- FastPropertyAccessor.cs
- DispatcherHookEventArgs.cs
- FatalException.cs
- ACE.cs
- WindowsAuthenticationModule.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ModelItemCollection.cs
- ModelUIElement3D.cs
- FileCodeGroup.cs
- DropSource.cs
- RectIndependentAnimationStorage.cs
- PropertyCollection.cs
- MarkedHighlightComponent.cs
- MemberRelationshipService.cs
- CqlIdentifiers.cs
- WindowsPen.cs
- autovalidator.cs
- CatalogZoneBase.cs
- LabelDesigner.cs
- WebPartMenuStyle.cs
- HttpDebugHandler.cs
- CqlGenerator.cs
- XPathDocumentBuilder.cs
- ListBindableAttribute.cs