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
- SessionStateItemCollection.cs
- TcpChannelListener.cs
- ListItemsCollectionEditor.cs
- CodeStatement.cs
- XmlSchemaComplexContentRestriction.cs
- EmptyReadOnlyDictionaryInternal.cs
- EventMappingSettings.cs
- DocumentPageTextView.cs
- TextParagraph.cs
- ListBox.cs
- BufferModesCollection.cs
- CompilerGlobalScopeAttribute.cs
- DataException.cs
- PropagatorResult.cs
- TextEditorLists.cs
- AbstractExpressions.cs
- UserControl.cs
- IDReferencePropertyAttribute.cs
- SystemIPInterfaceStatistics.cs
- ContentPropertyAttribute.cs
- XpsLiterals.cs
- NegationPusher.cs
- ObjectDesignerDataSourceView.cs
- ArithmeticException.cs
- DataViewManager.cs
- CompilerTypeWithParams.cs
- DataGridViewLinkColumn.cs
- WindowsListViewGroup.cs
- TableLayoutStyleCollection.cs
- QueryOptionExpression.cs
- ParseChildrenAsPropertiesAttribute.cs
- UnsafeNativeMethods.cs
- XsltLibrary.cs
- InfoCardProofToken.cs
- UdpRetransmissionSettings.cs
- SecurityDocument.cs
- FileLoadException.cs
- XamlWriter.cs
- StrokeSerializer.cs
- LazyTextWriterCreator.cs
- httpserverutility.cs
- SQLDoubleStorage.cs
- DataSourceExpression.cs
- ItemPager.cs
- NullableFloatSumAggregationOperator.cs
- ImageListStreamer.cs
- AssociationSetEnd.cs
- MarkupProperty.cs
- SemanticResolver.cs
- ControlCollection.cs
- ComAdminWrapper.cs
- XmlEventCache.cs
- EmptyReadOnlyDictionaryInternal.cs
- DataGridViewCellParsingEventArgs.cs
- _UriTypeConverter.cs
- QualifiedCellIdBoolean.cs
- DependencyObject.cs
- FixedTextContainer.cs
- TemplateParser.cs
- TextBox.cs
- TreeNodeClickEventArgs.cs
- CollectionConverter.cs
- Hash.cs
- IItemContainerGenerator.cs
- TimelineGroup.cs
- MembershipSection.cs
- DATA_BLOB.cs
- ValueTable.cs
- Rect3D.cs
- ProfileGroupSettingsCollection.cs
- SessionParameter.cs
- FixedPosition.cs
- PlacementWorkspace.cs
- SqlStatistics.cs
- SolidColorBrush.cs
- ReferentialConstraint.cs
- XPathSelectionIterator.cs
- nulltextcontainer.cs
- CheckBoxField.cs
- DispatcherExceptionFilterEventArgs.cs
- DecoderBestFitFallback.cs
- ObjectSpanRewriter.cs
- PlatformCulture.cs
- ElementAction.cs
- Positioning.cs
- FlowDocumentReader.cs
- HttpListenerRequestTraceRecord.cs
- ExpressionBuilderContext.cs
- HtmlInputButton.cs
- GcSettings.cs
- EmptyControlCollection.cs
- BookmarkWorkItem.cs
- MessageBox.cs
- SqlConnectionStringBuilder.cs
- FormsAuthenticationModule.cs
- ItemsControl.cs
- IncrementalCompileAnalyzer.cs
- InputMethodStateChangeEventArgs.cs
- AccessViolationException.cs
- InstanceView.cs