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
- ValueProviderWrapper.cs
- InputMethod.cs
- TriggerActionCollection.cs
- WmlCalendarAdapter.cs
- ExecutionEngineException.cs
- XmlLinkedNode.cs
- FreezableOperations.cs
- DocumentViewer.cs
- X509CertificateCollection.cs
- DataGridViewCheckBoxCell.cs
- ReflectPropertyDescriptor.cs
- SessionStateItemCollection.cs
- MinMaxParagraphWidth.cs
- CardSpaceException.cs
- AddingNewEventArgs.cs
- DrawItemEvent.cs
- ActiveDocumentEvent.cs
- CodeEventReferenceExpression.cs
- ReaderContextStackData.cs
- TableLayoutPanelCellPosition.cs
- ConnectionStringSettingsCollection.cs
- Duration.cs
- ViewGenerator.cs
- WebSysDisplayNameAttribute.cs
- XmlSchemaGroupRef.cs
- ToolboxBitmapAttribute.cs
- CompModSwitches.cs
- DateTimeOffset.cs
- XmlParserContext.cs
- MediaSystem.cs
- QueryExtender.cs
- DurableInstanceContextProvider.cs
- Brush.cs
- WebPartZoneBase.cs
- CompilerLocalReference.cs
- FixedHighlight.cs
- AuthenticateEventArgs.cs
- ChangeProcessor.cs
- DataSourceCache.cs
- RangeBaseAutomationPeer.cs
- ValidatedControlConverter.cs
- AnonymousIdentificationModule.cs
- XmlObjectSerializerReadContextComplex.cs
- PageAsyncTask.cs
- DependencyPropertyHelper.cs
- GatewayDefinition.cs
- DataGridState.cs
- ParserStreamGeometryContext.cs
- ListViewGroupCollectionEditor.cs
- Keywords.cs
- Viewport3DVisual.cs
- ThicknessAnimation.cs
- FontStyleConverter.cs
- LineInfo.cs
- ProtocolsConfigurationEntry.cs
- XappLauncher.cs
- MediaPlayer.cs
- Stacktrace.cs
- BinaryFormatter.cs
- TrackBar.cs
- BuildProvidersCompiler.cs
- FileResponseElement.cs
- MobileControlBuilder.cs
- ContractMethodInfo.cs
- CacheChildrenQuery.cs
- PermissionSet.cs
- ErrorStyle.cs
- GridViewUpdateEventArgs.cs
- RotateTransform3D.cs
- CorrelationKeyCalculator.cs
- SchemaNamespaceManager.cs
- SystemWebSectionGroup.cs
- HttpRuntime.cs
- HandlerFactoryWrapper.cs
- shaperfactoryquerycachekey.cs
- XmlLoader.cs
- SocketPermission.cs
- TypeSource.cs
- StreamUpdate.cs
- NonBatchDirectoryCompiler.cs
- TextServicesCompartmentEventSink.cs
- figurelength.cs
- MetadataWorkspace.cs
- SiteMapHierarchicalDataSourceView.cs
- TableRow.cs
- EventWaitHandle.cs
- Stylesheet.cs
- BitmapPalettes.cs
- ToolStripItemEventArgs.cs
- DataService.cs
- SmiEventSink_DeferedProcessing.cs
- SEHException.cs
- SmtpReplyReader.cs
- GB18030Encoding.cs
- MinimizableAttributeTypeConverter.cs
- AssemblyNameUtility.cs
- TreeNodeEventArgs.cs
- ConnectionsZone.cs
- IRCollection.cs
- ExtensionQuery.cs