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
- Sql8ExpressionRewriter.cs
- TCPClient.cs
- MatrixAnimationBase.cs
- ReliableInputConnection.cs
- Base64Stream.cs
- TextTreeTextBlock.cs
- UrlAuthorizationModule.cs
- baseaxisquery.cs
- cookieexception.cs
- WsatConfiguration.cs
- UserControlParser.cs
- SplineKeyFrames.cs
- PatternMatcher.cs
- RectangleGeometry.cs
- Bitmap.cs
- NullableLongMinMaxAggregationOperator.cs
- BinaryUtilClasses.cs
- ExecutionPropertyManager.cs
- DataSourceView.cs
- OleDbInfoMessageEvent.cs
- TypeDescriptionProviderAttribute.cs
- Base64Decoder.cs
- ComboBoxItem.cs
- DataMember.cs
- SqlBuilder.cs
- PageBuildProvider.cs
- Process.cs
- RequestCachePolicy.cs
- InsufficientMemoryException.cs
- TextSelectionHighlightLayer.cs
- UnauthorizedWebPart.cs
- ComboBox.cs
- DataControlButton.cs
- DocobjHost.cs
- HotSpot.cs
- Storyboard.cs
- BuildResultCache.cs
- HWStack.cs
- Transactions.cs
- _SafeNetHandles.cs
- HtmlContainerControl.cs
- ExecutionScope.cs
- XMLSchema.cs
- XmlSchemaSimpleTypeRestriction.cs
- _NativeSSPI.cs
- ObjectConverter.cs
- ControlValuePropertyAttribute.cs
- SqlDuplicator.cs
- KeyValueSerializer.cs
- StartUpEventArgs.cs
- SortedList.cs
- BaseTemplateParser.cs
- StringCollectionMarkupSerializer.cs
- ResXResourceWriter.cs
- DataBoundControl.cs
- KeyedCollection.cs
- ResourceLoader.cs
- TcpClientSocketManager.cs
- XmlNodeReader.cs
- Tokenizer.cs
- TextBoxAutoCompleteSourceConverter.cs
- NativeRecognizer.cs
- SqlRewriteScalarSubqueries.cs
- IISUnsafeMethods.cs
- CfgParser.cs
- MethodRental.cs
- Point4DValueSerializer.cs
- AsymmetricSignatureFormatter.cs
- UpDownBase.cs
- BitArray.cs
- HttpServerProtocol.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- PersistChildrenAttribute.cs
- DataTrigger.cs
- DictionarySectionHandler.cs
- CultureInfo.cs
- FormatSettings.cs
- HitTestWithPointDrawingContextWalker.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- XmlSchemaFacet.cs
- PersonalizationEntry.cs
- PathFigureCollection.cs
- SolidBrush.cs
- UnsettableComboBox.cs
- XmlSerializationWriter.cs
- HasCopySemanticsAttribute.cs
- MessageBox.cs
- AssociationSetMetadata.cs
- TCPListener.cs
- SplineQuaternionKeyFrame.cs
- ProfileModule.cs
- CustomCredentialPolicy.cs
- DockAndAnchorLayout.cs
- ActionMessageFilterTable.cs
- ApplicationFileParser.cs
- CompositeKey.cs
- TextServicesHost.cs
- RawUIStateInputReport.cs
- Shape.cs
- CompositeActivityCodeGenerator.cs