Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UriSectionData.cs
- Int32Storage.cs
- List.cs
- ToolStripPanelCell.cs
- Point3DIndependentAnimationStorage.cs
- ConfigXmlCDataSection.cs
- Application.cs
- XamlReader.cs
- Expr.cs
- OracleTimeSpan.cs
- ImageMap.cs
- InvariantComparer.cs
- updateconfighost.cs
- DocumentPageViewAutomationPeer.cs
- MenuAutomationPeer.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- SvcMapFile.cs
- AtomEntry.cs
- RectangleGeometry.cs
- CounterCreationDataCollection.cs
- TemplateBamlTreeBuilder.cs
- TypeDescriptionProvider.cs
- MessageLogger.cs
- EventDescriptor.cs
- ImageFormatConverter.cs
- SQLStringStorage.cs
- RepeaterDesigner.cs
- Int64Animation.cs
- SR.cs
- HtmlInputText.cs
- FlowDocumentPageViewerAutomationPeer.cs
- BamlBinaryReader.cs
- ToolStripGrip.cs
- SqlRetyper.cs
- PeerNearMe.cs
- ComboBoxRenderer.cs
- MenuItemStyle.cs
- ExtendedPropertyCollection.cs
- TableItemStyle.cs
- MaterialGroup.cs
- TypeUtil.cs
- MetadataUtilsSmi.cs
- DbQueryCommandTree.cs
- LineUtil.cs
- InputManager.cs
- RegexBoyerMoore.cs
- FrameAutomationPeer.cs
- TileBrush.cs
- InfoCardHelper.cs
- RunWorkerCompletedEventArgs.cs
- DbDataReader.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TrackingCondition.cs
- TableLayoutCellPaintEventArgs.cs
- ExpressionConverter.cs
- NamespaceListProperty.cs
- MD5CryptoServiceProvider.cs
- TrayIconDesigner.cs
- ResourceReferenceExpressionConverter.cs
- Queue.cs
- SoapIgnoreAttribute.cs
- RuntimeHelpers.cs
- SettingsPropertyNotFoundException.cs
- GenericParameterDataContract.cs
- GroupLabel.cs
- CompressedStack.cs
- HttpModulesSection.cs
- DesignTimeParseData.cs
- OperationResponse.cs
- XmlDataCollection.cs
- FillBehavior.cs
- _HeaderInfo.cs
- AutomationElementCollection.cs
- RepeatButton.cs
- AttachedPropertyBrowsableAttribute.cs
- LateBoundBitmapDecoder.cs
- ScrollChrome.cs
- panel.cs
- MimeImporter.cs
- SortQuery.cs
- XamlFxTrace.cs
- HttpSocketManager.cs
- Solver.cs
- Debug.cs
- DesignerDataSourceView.cs
- StyleSelector.cs
- WebPartAddingEventArgs.cs
- WebZoneDesigner.cs
- DetailsViewPagerRow.cs
- SQLDecimalStorage.cs
- ViewCellRelation.cs
- controlskin.cs
- ServicePoint.cs
- CommandTreeTypeHelper.cs
- infer.cs
- DoubleAnimationUsingPath.cs
- CounterCreationData.cs
- DataSourceCacheDurationConverter.cs
- RayMeshGeometry3DHitTestResult.cs
- SqlCommand.cs