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
- EventListener.cs
- GridView.cs
- Timer.cs
- Compensation.cs
- ClassHandlersStore.cs
- EdmComplexPropertyAttribute.cs
- EventLogRecord.cs
- TimelineClockCollection.cs
- ServiceOperation.cs
- PropertyFilter.cs
- TreeViewEvent.cs
- PlanCompiler.cs
- IFlowDocumentViewer.cs
- RenderDataDrawingContext.cs
- SQLBytes.cs
- UnsafeNativeMethods.cs
- filewebrequest.cs
- XmlResolver.cs
- XmlSchemaDocumentation.cs
- QilXmlReader.cs
- OperatingSystemVersionCheck.cs
- SymbolDocumentGenerator.cs
- AtomParser.cs
- DurationConverter.cs
- XmlSerializerSection.cs
- TextTrailingCharacterEllipsis.cs
- PersistChildrenAttribute.cs
- SrgsDocumentParser.cs
- HwndKeyboardInputProvider.cs
- SessionParameter.cs
- Subtree.cs
- CharUnicodeInfo.cs
- RightsManagementEncryptedStream.cs
- EncryptedXml.cs
- SQLDecimalStorage.cs
- AsyncOperationManager.cs
- Timer.cs
- Page.cs
- ButtonFieldBase.cs
- DBCommandBuilder.cs
- Button.cs
- SelectionItemProviderWrapper.cs
- DataSourceHelper.cs
- BitmapCodecInfoInternal.cs
- SolidBrush.cs
- FrameworkElementFactory.cs
- TriggerBase.cs
- CodeComment.cs
- EdmComplexTypeAttribute.cs
- DocumentXmlWriter.cs
- RemoteAsymmetricSignatureFormatter.cs
- IWorkflowDebuggerService.cs
- SecurityTokenTypes.cs
- XMLSyntaxException.cs
- XmlAttributeProperties.cs
- OptimalBreakSession.cs
- CharKeyFrameCollection.cs
- OleDbInfoMessageEvent.cs
- ReflectionUtil.cs
- RadioButtonFlatAdapter.cs
- RuleSetCollection.cs
- EventProviderWriter.cs
- GroupAggregateExpr.cs
- ScriptingSectionGroup.cs
- BamlWriter.cs
- SplineKeyFrames.cs
- PageParserFilter.cs
- MethodRental.cs
- datacache.cs
- SqlDataSourceSelectingEventArgs.cs
- ProvidersHelper.cs
- FileStream.cs
- CqlLexerHelpers.cs
- BitmapEffectGroup.cs
- Attributes.cs
- DefaultValueAttribute.cs
- ProfileService.cs
- XPathDocumentNavigator.cs
- ComponentSerializationService.cs
- ObjRef.cs
- DataGridViewRow.cs
- IntSecurity.cs
- LogArchiveSnapshot.cs
- TimeEnumHelper.cs
- ProfileProvider.cs
- NetworkStream.cs
- SapiRecognizer.cs
- Setter.cs
- Opcode.cs
- SqlColumnizer.cs
- MouseActionValueSerializer.cs
- StateElementCollection.cs
- Guid.cs
- EtwTrace.cs
- XmlDeclaration.cs
- OracleInternalConnection.cs
- TemplateNameScope.cs
- DataServiceEntityAttribute.cs
- SchemaTypeEmitter.cs
- InputBuffer.cs