Code:
/ DotNET / DotNET / 8.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
- ExpressionConverter.cs
- VisualTransition.cs
- EntityDataSourceQueryBuilder.cs
- MatrixValueSerializer.cs
- CompositionAdorner.cs
- DifferencingCollection.cs
- TakeOrSkipQueryOperator.cs
- RootBrowserWindow.cs
- ArgumentNullException.cs
- ADMembershipUser.cs
- LeaseManager.cs
- ConstraintCollection.cs
- Label.cs
- OperationCanceledException.cs
- InteropTrackingRecord.cs
- MissingManifestResourceException.cs
- ListViewSelectEventArgs.cs
- ValidatorCompatibilityHelper.cs
- IISMapPath.cs
- SecurityTokenException.cs
- SafeNativeMethods.cs
- FaultException.cs
- DictionaryBase.cs
- EmbeddedMailObjectsCollection.cs
- XPathCompileException.cs
- PersistencePipeline.cs
- RTLAwareMessageBox.cs
- DataGridViewRowCollection.cs
- cookie.cs
- ScrollableControl.cs
- UserMapPath.cs
- ListViewCancelEventArgs.cs
- UnsafeNativeMethods.cs
- GroupItemAutomationPeer.cs
- WindowsFormsHelpers.cs
- TextBox.cs
- PropertyStore.cs
- PrincipalPermission.cs
- DbUpdateCommandTree.cs
- FormCollection.cs
- COM2EnumConverter.cs
- dbenumerator.cs
- DataGridPreparingCellForEditEventArgs.cs
- ObjRef.cs
- DbTransaction.cs
- ToolStripContentPanel.cs
- MultiSelectRootGridEntry.cs
- CategoryAttribute.cs
- XmlSchemaSet.cs
- diagnosticsswitches.cs
- ContainerAction.cs
- DataGridViewColumnDesigner.cs
- ToolStripLabel.cs
- X509Extension.cs
- OperatingSystemVersionCheck.cs
- TextParagraph.cs
- BuildResult.cs
- Version.cs
- ListSortDescriptionCollection.cs
- BulletedList.cs
- CompiledRegexRunner.cs
- oledbconnectionstring.cs
- AttachedPropertyMethodSelector.cs
- DesignerCalendarAdapter.cs
- PromptEventArgs.cs
- ProgressPage.cs
- ImageAutomationPeer.cs
- ExeConfigurationFileMap.cs
- IgnoreFileBuildProvider.cs
- InvocationExpression.cs
- Variant.cs
- ToolStripControlHost.cs
- EditCommandColumn.cs
- LayoutSettings.cs
- ThemeDirectoryCompiler.cs
- CodeGroup.cs
- RawStylusInput.cs
- HandlerFactoryCache.cs
- ShaderRenderModeValidation.cs
- UriExt.cs
- Geometry3D.cs
- SoapEnvelopeProcessingElement.cs
- HtmlInputPassword.cs
- Suspend.cs
- ScopelessEnumAttribute.cs
- SimpleFileLog.cs
- DBParameter.cs
- _FtpControlStream.cs
- RangeContentEnumerator.cs
- HttpException.cs
- TraceHandlerErrorFormatter.cs
- Fonts.cs
- DatePickerAutomationPeer.cs
- MediaContext.cs
- QilPatternVisitor.cs
- DragDrop.cs
- HashAlgorithm.cs
- NullableLongAverageAggregationOperator.cs
- SqlCacheDependencyDatabase.cs
- PropertyNames.cs