Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / xsp / System / Web / Extensions / ui / PostBackTrigger.cs / 1 / 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
- AutomationElementCollection.cs
- EntityDataSourceColumn.cs
- AutomationEvent.cs
- LogSwitch.cs
- path.cs
- AsymmetricAlgorithm.cs
- GroupQuery.cs
- Button.cs
- DesignerVerbCollection.cs
- PlaceHolder.cs
- ModuleElement.cs
- CalendarTable.cs
- BufferedReadStream.cs
- querybuilder.cs
- Group.cs
- WriterOutput.cs
- ProfileSettingsCollection.cs
- TypeDescriptionProvider.cs
- CodeTypeParameter.cs
- RectangleGeometry.cs
- GroupLabel.cs
- Triangle.cs
- GatewayIPAddressInformationCollection.cs
- COM2Properties.cs
- VideoDrawing.cs
- XPathQilFactory.cs
- AssertSection.cs
- PageThemeParser.cs
- TemplatePropertyEntry.cs
- SafeLocalMemHandle.cs
- XmlArrayItemAttribute.cs
- EmbeddedObject.cs
- LinkButton.cs
- OrderByBuilder.cs
- StylusDownEventArgs.cs
- StandardBindingOptionalReliableSessionElement.cs
- DataBinder.cs
- DbProviderFactoriesConfigurationHandler.cs
- XmlWriterSettings.cs
- DbBuffer.cs
- CmsInterop.cs
- ClonableStack.cs
- ProfileEventArgs.cs
- SplitContainer.cs
- PostBackTrigger.cs
- AmbiguousMatchException.cs
- basecomparevalidator.cs
- MarkedHighlightComponent.cs
- XmlSerializer.cs
- TypeSemantics.cs
- WebPartChrome.cs
- SmiMetaData.cs
- TreeNodeBindingDepthConverter.cs
- SQLDateTime.cs
- WinFormsUtils.cs
- WebPartsSection.cs
- TextTreeText.cs
- StateChangeEvent.cs
- HttpContextWrapper.cs
- GenerateScriptTypeAttribute.cs
- IResourceProvider.cs
- IDReferencePropertyAttribute.cs
- X509CertificateValidator.cs
- ErrorLog.cs
- TemplateManager.cs
- AnimationClockResource.cs
- StringSorter.cs
- AnimationTimeline.cs
- RegexGroupCollection.cs
- OraclePermissionAttribute.cs
- DockPatternIdentifiers.cs
- Vector3D.cs
- ToolStripScrollButton.cs
- PtsPage.cs
- HwndHost.cs
- InvalidContentTypeException.cs
- XmlSchemaImporter.cs
- DataIdProcessor.cs
- ActivityBuilderXamlWriter.cs
- OutputCacheSection.cs
- EventLogPermissionAttribute.cs
- ObjectCacheSettings.cs
- XmlException.cs
- CapacityStreamGeometryContext.cs
- Parser.cs
- MessageSecurityOverHttp.cs
- ListViewHitTestInfo.cs
- EntityContainerAssociationSet.cs
- SR.cs
- OperationPerformanceCounters.cs
- MetadataWorkspace.cs
- SiteIdentityPermission.cs
- DefaultPrintController.cs
- SQLDateTime.cs
- SmiContextFactory.cs
- SolidColorBrush.cs
- ConnectionManagementElementCollection.cs
- ImageInfo.cs
- Quaternion.cs
- ResolveMatchesApril2005.cs