Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XmlSchemaAnnotation.cs
- ListDesigner.cs
- RijndaelManaged.cs
- MetadataPropertyvalue.cs
- CustomValidator.cs
- SetterBase.cs
- KeyBinding.cs
- CustomAttributeFormatException.cs
- MatrixStack.cs
- HandledMouseEvent.cs
- StylusLogic.cs
- ColorContext.cs
- XslCompiledTransform.cs
- DataColumnPropertyDescriptor.cs
- Content.cs
- ColumnTypeConverter.cs
- BinaryKeyIdentifierClause.cs
- SuppressMergeCheckAttribute.cs
- PortCache.cs
- DesignerActionListCollection.cs
- DataControlCommands.cs
- WindowsImpersonationContext.cs
- ToolStripControlHost.cs
- XmlAttributeProperties.cs
- ListViewTableCell.cs
- RectAnimationBase.cs
- precedingsibling.cs
- UnsafeNativeMethods.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- ViewManager.cs
- WindowsListViewGroupHelper.cs
- DelegateInArgument.cs
- SiteMapNodeItem.cs
- EditorPart.cs
- LabelAutomationPeer.cs
- objectresult_tresulttype.cs
- NavigationEventArgs.cs
- securitycriticaldataClass.cs
- WindowsScroll.cs
- ProcessStartInfo.cs
- UIElement3D.cs
- CollectionAdapters.cs
- HotCommands.cs
- LoginName.cs
- GetPageNumberCompletedEventArgs.cs
- SkinBuilder.cs
- x509store.cs
- webproxy.cs
- NavigationExpr.cs
- XmlUtf8RawTextWriter.cs
- MdiWindowListStrip.cs
- FixedTextView.cs
- ToolBarPanel.cs
- ReadingWritingEntityEventArgs.cs
- parserscommon.cs
- BufferedGraphics.cs
- DataGridView.cs
- ManifestResourceInfo.cs
- TcpSocketManager.cs
- EventLogInternal.cs
- AvTraceFormat.cs
- oledbmetadatacollectionnames.cs
- ParserHooks.cs
- TextAction.cs
- XmlSerializer.cs
- BrowserTree.cs
- IApplicationTrustManager.cs
- WorkflowDesignerMessageFilter.cs
- ShimAsPublicXamlType.cs
- SuppressMessageAttribute.cs
- ObjectViewListener.cs
- PngBitmapEncoder.cs
- PagePropertiesChangingEventArgs.cs
- DataListCommandEventArgs.cs
- DataGridRow.cs
- XmlBoundElement.cs
- BuildResult.cs
- StickyNoteContentControl.cs
- regiisutil.cs
- WorkflowTransactionService.cs
- PropertyInformationCollection.cs
- DataSourceHelper.cs
- EncryptedXml.cs
- KoreanCalendar.cs
- FileDialogPermission.cs
- ContractCodeDomInfo.cs
- DrawingVisual.cs
- OutputScopeManager.cs
- FacetEnabledSchemaElement.cs
- BitmapPalette.cs
- ActivityMetadata.cs
- StorageComplexTypeMapping.cs
- DocComment.cs
- OdbcParameterCollection.cs
- MembershipAdapter.cs
- PaperSource.cs
- AppDomainUnloadedException.cs
- _WinHttpWebProxyDataBuilder.cs
- Visual3DCollection.cs
- DurableOperationAttribute.cs