Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / Substitution.cs / 1 / Substitution.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Globalization; using System.Security.Permissions; using System.Web; using System.Web.UI; ////// [ DefaultProperty("MethodName"), Designer("System.Web.UI.Design.WebControls.SubstitutionDesigner, " + AssemblyRef.SystemDesign), ParseChildren(true), PersistChildren(false), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class Substitution : Control { ////// /// public Substitution() { } ////// /// [ DefaultValue(""), WebCategory("Behavior"), WebSysDescription(SR.Substitution_MethodNameDescr) ] public virtual string MethodName { get { string s = ViewState["MethodName"] as string; return s == null? String.Empty : s; } set { ViewState["MethodName"] = value; } } protected override ControlCollection CreateControlCollection() { return new EmptyControlCollection(this); } // SECURITY CODE // [ReflectionPermission(SecurityAction.Assert, Flags=ReflectionPermissionFlag.MemberAccess)] private HttpResponseSubstitutionCallback GetDelegate(Type targetType, string methodName) { return (HttpResponseSubstitutionCallback)Delegate.CreateDelegate( typeof(HttpResponseSubstitutionCallback), targetType, methodName); } protected internal override void OnPreRender(EventArgs e) { base.OnPreRender(e); // Control parent = Parent; while (parent != null) { if (parent is BasePartialCachingControl) { throw new HttpException( SR.GetString(SR.Substitution_CannotBeInCachedControl)); } parent = parent.Parent; } } protected internal override void Render(HtmlTextWriter writer) { RenderMarkup(writer); } internal void RenderMarkup(HtmlTextWriter writer) { if (MethodName.Length == 0) { return; } TemplateControl target = TemplateControl; if (target == null) { return; } // get the delegate to the method HttpResponseSubstitutionCallback callback = null; try { callback = GetDelegate(target.GetType(), MethodName); } catch { } if (callback == null) { throw new HttpException( SR.GetString(SR.Substitution_BadMethodName, MethodName)); } // add the substitution to the response Page.Response.WriteSubstitution(callback); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MsmqInputMessage.cs
- HtmlInputSubmit.cs
- ReflectTypeDescriptionProvider.cs
- TrustSection.cs
- ArithmeticLiteral.cs
- CharKeyFrameCollection.cs
- SettingsProperty.cs
- CredentialManagerDialog.cs
- ElementHostAutomationPeer.cs
- AxHost.cs
- CommandDesigner.cs
- LineSegment.cs
- ActivityDesignerResources.cs
- GridViewHeaderRowPresenter.cs
- XmlUnspecifiedAttribute.cs
- XmlSchemaGroupRef.cs
- ErrorRuntimeConfig.cs
- Pair.cs
- TextServicesPropertyRanges.cs
- linebase.cs
- FtpWebRequest.cs
- HostedHttpContext.cs
- PerfCounterSection.cs
- Matrix.cs
- ImageMapEventArgs.cs
- ClearTypeHintValidation.cs
- ToolStripPanelRow.cs
- BufferedStream2.cs
- SettingsPropertyValue.cs
- DesigntimeLicenseContext.cs
- CompressEmulationStream.cs
- SmtpDigestAuthenticationModule.cs
- DockPattern.cs
- EtwTrace.cs
- WindowsIPAddress.cs
- IpcServerChannel.cs
- StringConverter.cs
- SHA384.cs
- ColorBlend.cs
- PageBreakRecord.cs
- XmlNodeReader.cs
- DataTableReaderListener.cs
- StorageConditionPropertyMapping.cs
- StateBag.cs
- QueryIntervalOp.cs
- ItemType.cs
- InvokeMemberBinder.cs
- WindowsAltTab.cs
- MulticastDelegate.cs
- StringAnimationBase.cs
- ImageField.cs
- PathTooLongException.cs
- NameValueSectionHandler.cs
- HttpCacheVary.cs
- HttpDebugHandler.cs
- DataGridAddNewRow.cs
- RadioButtonFlatAdapter.cs
- XmlSchemaImporter.cs
- StateBag.cs
- SerializationObjectManager.cs
- bindurihelper.cs
- UnconditionalPolicy.cs
- WindowsListBox.cs
- LazyTextWriterCreator.cs
- XmlSchemaType.cs
- IIS7UserPrincipal.cs
- SemaphoreFullException.cs
- MemoryPressure.cs
- TrustSection.cs
- XPathAxisIterator.cs
- DesignerMetadata.cs
- LineSegment.cs
- ClientTargetSection.cs
- securitycriticaldataformultiplegetandset.cs
- KoreanCalendar.cs
- ClientScriptManager.cs
- EnumCodeDomSerializer.cs
- DesignerEventService.cs
- ReadOnlyDictionary.cs
- NonVisualControlAttribute.cs
- OletxResourceManager.cs
- InertiaRotationBehavior.cs
- XXXInfos.cs
- ThreadStartException.cs
- BitmapEffectrendercontext.cs
- ReferenceConverter.cs
- SkinBuilder.cs
- ListView.cs
- WebPartTransformerAttribute.cs
- MultiAsyncResult.cs
- SessionPageStatePersister.cs
- ContentControl.cs
- CacheChildrenQuery.cs
- ColumnResizeAdorner.cs
- HttpRequest.cs
- DivideByZeroException.cs
- FunctionDetailsReader.cs
- Keyboard.cs
- IResourceProvider.cs
- ActivityScheduledQuery.cs