Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SoapInteropTypes.cs
- PassportAuthenticationEventArgs.cs
- WindowsScroll.cs
- ConfigDefinitionUpdates.cs
- ObjectReferenceStack.cs
- RecognizerStateChangedEventArgs.cs
- MethodCallConverter.cs
- CacheChildrenQuery.cs
- CategoryValueConverter.cs
- BinaryObjectWriter.cs
- ActivationArguments.cs
- XmlReflectionMember.cs
- BaseCollection.cs
- Separator.cs
- ServerIdentity.cs
- Table.cs
- ParallelTimeline.cs
- ClassHandlersStore.cs
- VersionPair.cs
- RawStylusInputCustomDataList.cs
- NetworkStream.cs
- EnumerableCollectionView.cs
- HttpRequestWrapper.cs
- TypefaceCollection.cs
- ResourceBinder.cs
- SiteOfOriginPart.cs
- EncoderNLS.cs
- JsonReader.cs
- DataRelation.cs
- RenderContext.cs
- SignedXml.cs
- SymLanguageType.cs
- DomNameTable.cs
- UIPropertyMetadata.cs
- MDIWindowDialog.cs
- __Error.cs
- SemanticResultValue.cs
- DatePickerDateValidationErrorEventArgs.cs
- XmlnsCache.cs
- ModifiableIteratorCollection.cs
- ConfigXmlText.cs
- BamlTreeNode.cs
- IPPacketInformation.cs
- PageParserFilter.cs
- securitycriticaldataClass.cs
- DataColumnPropertyDescriptor.cs
- QuadraticBezierSegment.cs
- QilXmlWriter.cs
- ActivityValidator.cs
- ContextQuery.cs
- PartialCachingAttribute.cs
- MobileUserControlDesigner.cs
- complextypematerializer.cs
- ProcessStartInfo.cs
- ItemsPresenter.cs
- SuppressIldasmAttribute.cs
- ObfuscationAttribute.cs
- FixedPageAutomationPeer.cs
- FixedSOMPageElement.cs
- ValueTypeFixupInfo.cs
- ActivityDesignerLayoutSerializers.cs
- VirtualizedContainerService.cs
- FontSourceCollection.cs
- XmlSchemaAttributeGroupRef.cs
- X509ServiceCertificateAuthenticationElement.cs
- Slider.cs
- RsaSecurityTokenAuthenticator.cs
- XmlAutoDetectWriter.cs
- MemoryFailPoint.cs
- EmptyCollection.cs
- TemplateBindingExpression.cs
- EntityDataSourceChangingEventArgs.cs
- ListMarkerLine.cs
- AutomationProperties.cs
- LogicalExpressionTypeConverter.cs
- Effect.cs
- MissingMethodException.cs
- SubstitutionResponseElement.cs
- ClientSettingsProvider.cs
- ConfigXmlDocument.cs
- ProfileEventArgs.cs
- TemplateEditingVerb.cs
- Image.cs
- StructuredTypeInfo.cs
- ObjectStateEntryDbDataRecord.cs
- WindowsSysHeader.cs
- SuspendDesigner.cs
- Emitter.cs
- Double.cs
- RtfToXamlReader.cs
- ArgIterator.cs
- StreamedFramingRequestChannel.cs
- Parsers.cs
- SqlComparer.cs
- AvTrace.cs
- TypeHelper.cs
- ListViewTableCell.cs
- QuadraticBezierSegment.cs
- COM2FontConverter.cs
- DeclaredTypeValidator.cs