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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EditingMode.cs
- AnnotationResourceChangedEventArgs.cs
- SwitchExpression.cs
- ProgressPage.cs
- SimpleBitVector32.cs
- WsatServiceCertificate.cs
- CleanUpVirtualizedItemEventArgs.cs
- OdbcConnectionHandle.cs
- ScriptHandlerFactory.cs
- SerialReceived.cs
- DiagnosticTrace.cs
- DataGridViewImageColumn.cs
- TimeSpanValidator.cs
- SqlCacheDependencySection.cs
- HwndKeyboardInputProvider.cs
- SafeNativeMethodsMilCoreApi.cs
- SmiEventSink_Default.cs
- ClientScriptManagerWrapper.cs
- QueryContinueDragEventArgs.cs
- RepeatButton.cs
- XPathSelfQuery.cs
- SeekStoryboard.cs
- ActivityMarkupSerializationProvider.cs
- StyleBamlRecordReader.cs
- BrowserCapabilitiesCompiler.cs
- ApplicationServicesHostFactory.cs
- ThrowHelper.cs
- RoutedEventConverter.cs
- ValidationEventArgs.cs
- precedingsibling.cs
- Range.cs
- TraceContext.cs
- RequestCache.cs
- baseaxisquery.cs
- EventsTab.cs
- XsdDateTime.cs
- OrderedDictionary.cs
- ConfigXmlCDataSection.cs
- TabControlAutomationPeer.cs
- ClientUtils.cs
- BaseComponentEditor.cs
- NegationPusher.cs
- ConfigurationSectionGroup.cs
- ValueChangedEventManager.cs
- FormViewUpdatedEventArgs.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- RegexStringValidator.cs
- regiisutil.cs
- ParagraphResult.cs
- AsymmetricCryptoHandle.cs
- EpmSourceTree.cs
- NativeActivityFaultContext.cs
- RowTypePropertyElement.cs
- PropertyCollection.cs
- DataGridViewTextBoxColumn.cs
- SafeBitVector32.cs
- diagnosticsswitches.cs
- SqlRecordBuffer.cs
- Sql8ExpressionRewriter.cs
- EntityCommand.cs
- EntityViewGenerator.cs
- FtpRequestCacheValidator.cs
- DefaultCommandConverter.cs
- MailAddressCollection.cs
- WorkflowOperationContext.cs
- XPathDescendantIterator.cs
- LinqTreeNodeEvaluator.cs
- Decoder.cs
- ComplexType.cs
- SchemaImporterExtension.cs
- PropertyFilter.cs
- HWStack.cs
- DeclarativeCatalogPart.cs
- ListItemCollection.cs
- LinkConverter.cs
- ServiceParser.cs
- HashMembershipCondition.cs
- QilValidationVisitor.cs
- UserUseLicenseDictionaryLoader.cs
- HintTextConverter.cs
- ApplicationTrust.cs
- MergablePropertyAttribute.cs
- PackageRelationshipCollection.cs
- MemberInfoSerializationHolder.cs
- UpdateCommand.cs
- ParserHooks.cs
- WeakEventManager.cs
- BamlBinaryReader.cs
- ProcessThread.cs
- Rectangle.cs
- GridErrorDlg.cs
- HtmlAnchor.cs
- FrameDimension.cs
- XD.cs
- ApplicationServiceManager.cs
- ValidatedControlConverter.cs
- Message.cs
- ScrollBarAutomationPeer.cs
- InheritanceAttribute.cs
- XmlDocumentType.cs