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
- TemplateKeyConverter.cs
- RotateTransform.cs
- DbDataAdapter.cs
- HwndTarget.cs
- FtpWebResponse.cs
- Attributes.cs
- DefinitionBase.cs
- DES.cs
- MenuItemBindingCollection.cs
- XmlAttributeHolder.cs
- HintTextConverter.cs
- WebPartDisplayModeEventArgs.cs
- TextLine.cs
- EncryptedXml.cs
- UnaryNode.cs
- Tuple.cs
- LocatorBase.cs
- ProvidePropertyAttribute.cs
- EndEvent.cs
- SqlClientPermission.cs
- SecurityTokenSerializer.cs
- LayoutUtils.cs
- TableSectionStyle.cs
- DateTimeStorage.cs
- XmlEncodedRawTextWriter.cs
- ConfigurationValidatorAttribute.cs
- Storyboard.cs
- ConfigurationElementProperty.cs
- MessageDecoder.cs
- Matrix.cs
- DesignTimeParseData.cs
- ExtendedPropertyInfo.cs
- SendMailErrorEventArgs.cs
- ToolStripDropDown.cs
- CodeMemberField.cs
- TransformGroup.cs
- SmtpDigestAuthenticationModule.cs
- EnumerableCollectionView.cs
- FileLogRecordHeader.cs
- ExcCanonicalXml.cs
- DependencyObject.cs
- CodeSubDirectory.cs
- TrayIconDesigner.cs
- SqlConnectionStringBuilder.cs
- PersonalizationProvider.cs
- UIElement3D.cs
- ContainerUtilities.cs
- VisualTreeUtils.cs
- HashCodeCombiner.cs
- SerializableReadOnlyDictionary.cs
- Camera.cs
- UrlUtility.cs
- MeasureItemEvent.cs
- Collection.cs
- ButtonBaseAdapter.cs
- MutexSecurity.cs
- Subtree.cs
- StringBlob.cs
- HeaderedItemsControl.cs
- ModelItem.cs
- DbConnectionPoolCounters.cs
- HandleCollector.cs
- X509Utils.cs
- OledbConnectionStringbuilder.cs
- EventLogTraceListener.cs
- Vector.cs
- WebHttpElement.cs
- TextEditorContextMenu.cs
- PenLineJoinValidation.cs
- HostedAspNetEnvironment.cs
- VerticalAlignConverter.cs
- Msec.cs
- ToolStripSeparator.cs
- ItemsPanelTemplate.cs
- CryptographicAttribute.cs
- GeometryCollection.cs
- Addressing.cs
- GridViewDeleteEventArgs.cs
- SettingsPropertyValue.cs
- DictionaryCustomTypeDescriptor.cs
- FlowDocumentPaginator.cs
- HwndMouseInputProvider.cs
- connectionpool.cs
- HandledMouseEvent.cs
- LogEntryHeaderDeserializer.cs
- ReflectionHelper.cs
- CompilerScope.cs
- DesignerActionListCollection.cs
- SynchronizationContextHelper.cs
- Int16Storage.cs
- FormViewInsertEventArgs.cs
- DefaultParameterValueAttribute.cs
- GridViewDeleteEventArgs.cs
- ProtocolProfile.cs
- DecimalAnimationBase.cs
- BatchParser.cs
- KeyNotFoundException.cs
- MenuItemStyle.cs
- WmlValidationSummaryAdapter.cs
- DataControlFieldCell.cs