Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XAMLParseException.cs
- RedistVersionInfo.cs
- InkPresenter.cs
- ScrollProviderWrapper.cs
- Helpers.cs
- ProcessModule.cs
- WindowsGraphicsCacheManager.cs
- EntityDataSourceView.cs
- WorkItem.cs
- RadioButton.cs
- TraceSection.cs
- DbConnectionPoolGroup.cs
- OutputCacheSettings.cs
- WorkflowApplicationTerminatedException.cs
- LexicalChunk.cs
- ConfigurationValue.cs
- OleDbDataAdapter.cs
- LinkUtilities.cs
- SmtpClient.cs
- RelativeSource.cs
- ObjectSpanRewriter.cs
- SchemaNames.cs
- HttpServerChannel.cs
- PrimitiveXmlSerializers.cs
- TemplateControlBuildProvider.cs
- StretchValidation.cs
- CfgParser.cs
- ZipIOExtraField.cs
- ExpandoClass.cs
- PipelineModuleStepContainer.cs
- PageParser.cs
- StrokeNodeOperations.cs
- ProfileServiceManager.cs
- HtmlImage.cs
- Parser.cs
- Constraint.cs
- SoapHeaders.cs
- CqlParserHelpers.cs
- WorkflowApplicationAbortedEventArgs.cs
- EdmSchemaError.cs
- SqlPersonalizationProvider.cs
- OdbcRowUpdatingEvent.cs
- SqlDuplicator.cs
- ImageIndexConverter.cs
- Interfaces.cs
- DrawingAttributesDefaultValueFactory.cs
- PasswordTextContainer.cs
- ClipboardData.cs
- ToolStripItemClickedEventArgs.cs
- LocalizationParserHooks.cs
- HtmlInputHidden.cs
- RayMeshGeometry3DHitTestResult.cs
- StickyNoteAnnotations.cs
- WriteableBitmap.cs
- XPathItem.cs
- VerificationException.cs
- HttpModuleActionCollection.cs
- BinaryReader.cs
- ObjectDataSourceSelectingEventArgs.cs
- StoryFragments.cs
- CorrelationRequestContext.cs
- Trace.cs
- StreamWriter.cs
- RegexCompiler.cs
- CollaborationHelperFunctions.cs
- StreamReader.cs
- SocketManager.cs
- CoreSwitches.cs
- OLEDB_Enum.cs
- KeyValueConfigurationElement.cs
- HtmlTable.cs
- EventProviderWriter.cs
- TaskFormBase.cs
- SQLByteStorage.cs
- FrameSecurityDescriptor.cs
- DebugControllerThread.cs
- ControlAdapter.cs
- MatrixConverter.cs
- URLAttribute.cs
- MouseBinding.cs
- StatusBarPanelClickEvent.cs
- SqlUserDefinedTypeAttribute.cs
- HtmlInputReset.cs
- SplineKeyFrames.cs
- RegexTree.cs
- WindowsFont.cs
- CacheEntry.cs
- WhitespaceRuleReader.cs
- NetworkCredential.cs
- Cell.cs
- ObjectViewFactory.cs
- BulletChrome.cs
- ConfigPathUtility.cs
- VectorCollectionConverter.cs
- LinkedResourceCollection.cs
- CacheDependency.cs
- MessageDescriptionCollection.cs
- COM2EnumConverter.cs
- XdrBuilder.cs
- XmlSerializerAssemblyAttribute.cs