Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / ui / PostBackTrigger.cs / 3 / PostBackTrigger.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.Resources; using System.Web.Util; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) ] public class PostBackTrigger : UpdatePanelControlTrigger { private IScriptManagerInternal _scriptManager; public PostBackTrigger() { } internal PostBackTrigger(IScriptManagerInternal scriptManager) { _scriptManager = scriptManager; } [ SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID"), TypeConverter("System.Web.UI.Design.PostBackTriggerControlIDConverter, " + AssemblyRef.SystemWebExtensionsDesign) ] public new string ControlID { get { return base.ControlID; } set { base.ControlID = value; } } internal IScriptManagerInternal ScriptManager { get { if (_scriptManager == null) { Page page = Owner.Page; if (page == null) { throw new InvalidOperationException(AtlasWeb.Common_PageCannotBeNull); } _scriptManager = UI.ScriptManager.GetCurrent(page); if (_scriptManager == null) { throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.Common_ScriptManagerRequired, Owner.ID)); } } return _scriptManager; } } protected internal override void Initialize() { base.Initialize(); Control associatedControl = FindTargetControl(false); ScriptManager.RegisterPostBackControl(associatedControl); } protected internal override bool HasTriggered() { // This type of trigger never triggers since it causes a regular postback, // where all UpdatePanels render anyway. return false; } [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] public override string ToString() { if (String.IsNullOrEmpty(ControlID)) { return "PostBack"; } else { return "PostBack: " + ControlID; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.Resources; using System.Web.Util; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) ] public class PostBackTrigger : UpdatePanelControlTrigger { private IScriptManagerInternal _scriptManager; public PostBackTrigger() { } internal PostBackTrigger(IScriptManagerInternal scriptManager) { _scriptManager = scriptManager; } [ SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID"), TypeConverter("System.Web.UI.Design.PostBackTriggerControlIDConverter, " + AssemblyRef.SystemWebExtensionsDesign) ] public new string ControlID { get { return base.ControlID; } set { base.ControlID = value; } } internal IScriptManagerInternal ScriptManager { get { if (_scriptManager == null) { Page page = Owner.Page; if (page == null) { throw new InvalidOperationException(AtlasWeb.Common_PageCannotBeNull); } _scriptManager = UI.ScriptManager.GetCurrent(page); if (_scriptManager == null) { throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.Common_ScriptManagerRequired, Owner.ID)); } } return _scriptManager; } } protected internal override void Initialize() { base.Initialize(); Control associatedControl = FindTargetControl(false); ScriptManager.RegisterPostBackControl(associatedControl); } protected internal override bool HasTriggered() { // This type of trigger never triggers since it causes a regular postback, // where all UpdatePanels render anyway. return false; } [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] public override string ToString() { if (String.IsNullOrEmpty(ControlID)) { return "PostBack"; } else { return "PostBack: " + ControlID; } } } } // 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
- SqlConnectionPoolGroupProviderInfo.cs
- _NestedMultipleAsyncResult.cs
- WindowsTokenRoleProvider.cs
- SamlDelegatingWriter.cs
- Stream.cs
- ContainerActivationHelper.cs
- TcpAppDomainProtocolHandler.cs
- TreeView.cs
- ButtonBase.cs
- FileDialogCustomPlace.cs
- TransformerInfo.cs
- ExpressionBuilderContext.cs
- WebPartEditorCancelVerb.cs
- TextReturnReader.cs
- PropertyGroupDescription.cs
- MetadataExporter.cs
- Style.cs
- FloaterParagraph.cs
- Component.cs
- List.cs
- WebContext.cs
- TogglePattern.cs
- NativeMethods.cs
- SourceChangedEventArgs.cs
- XmlSchemaComplexContent.cs
- XamlClipboardData.cs
- RowSpanVector.cs
- SqlConnectionPoolGroupProviderInfo.cs
- HelpEvent.cs
- Header.cs
- SystemResourceKey.cs
- Accessors.cs
- CommonDialog.cs
- TextTreePropertyUndoUnit.cs
- Model3DGroup.cs
- DrawItemEvent.cs
- MSAANativeProvider.cs
- ReliableMessagingVersion.cs
- smtppermission.cs
- DomNameTable.cs
- LoadGrammarCompletedEventArgs.cs
- ThrowHelper.cs
- _CommandStream.cs
- HttpWebRequestElement.cs
- SqlReorderer.cs
- ClientCredentials.cs
- UIElementCollection.cs
- RegexCompiler.cs
- MsmqReceiveParameters.cs
- VScrollProperties.cs
- UrlAuthorizationModule.cs
- PrintControllerWithStatusDialog.cs
- EnvelopedPkcs7.cs
- Logging.cs
- PingReply.cs
- NativeMethods.cs
- ViewEventArgs.cs
- IntegerValidator.cs
- BamlCollectionHolder.cs
- ValueExpressions.cs
- Encoder.cs
- WrappedIUnknown.cs
- PointCollectionConverter.cs
- DetailsView.cs
- AppDomainCompilerProxy.cs
- EventDescriptorCollection.cs
- GradientStop.cs
- CodeIterationStatement.cs
- ObjectIDGenerator.cs
- Rights.cs
- MailDefinition.cs
- FileSystemInfo.cs
- TimeSpanMinutesConverter.cs
- NestPullup.cs
- BaseHashHelper.cs
- DataControlImageButton.cs
- Rect.cs
- SqlCacheDependency.cs
- ComplexBindingPropertiesAttribute.cs
- BehaviorDragDropEventArgs.cs
- Model3DCollection.cs
- ConfigurationErrorsException.cs
- StrongName.cs
- ComponentCollection.cs
- TransportOutputChannel.cs
- RuntimeConfigLKG.cs
- SmtpSection.cs
- InfoCardMasterKey.cs
- ConnectionManagementSection.cs
- DesignerEventService.cs
- MatrixUtil.cs
- QilTargetType.cs
- HttpPostedFile.cs
- ResourceLoader.cs
- EncryptedType.cs
- CompModHelpers.cs
- HostingEnvironmentWrapper.cs
- MonitorWrapper.cs
- SqlInternalConnection.cs
- OdbcEnvironment.cs