Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- Wildcard.cs
- TableTextElementCollectionInternal.cs
- DeferredTextReference.cs
- MenuBase.cs
- ParentQuery.cs
- MimeWriter.cs
- DesignObjectWrapper.cs
- SQLDoubleStorage.cs
- PhysicalFontFamily.cs
- PageBuildProvider.cs
- SiteMapNodeItemEventArgs.cs
- NativeCompoundFileAPIs.cs
- storepermission.cs
- PlainXmlSerializer.cs
- TreeNode.cs
- LinqDataSourceValidationException.cs
- RelatedImageListAttribute.cs
- SafeFileMappingHandle.cs
- ConfigXmlCDataSection.cs
- UTF7Encoding.cs
- Events.cs
- FontWeightConverter.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- ImageListStreamer.cs
- QueryGeneratorBase.cs
- ControlUtil.cs
- XamlReader.cs
- CodeGeneratorOptions.cs
- _BufferOffsetSize.cs
- SQLByte.cs
- DesignTimeTemplateParser.cs
- Italic.cs
- ControlParameter.cs
- BlurEffect.cs
- RawUIStateInputReport.cs
- ObjectParameter.cs
- PageThemeBuildProvider.cs
- DataPager.cs
- CompositionDesigner.cs
- ListControlDataBindingHandler.cs
- nulltextcontainer.cs
- EntityDataSourceValidationException.cs
- VariantWrapper.cs
- SerializerDescriptor.cs
- ByteStream.cs
- StrokeCollectionConverter.cs
- SpinWait.cs
- RectangleGeometry.cs
- HandlerWithFactory.cs
- DocumentPage.cs
- StylusPointDescription.cs
- ExtensionElement.cs
- BuilderElements.cs
- XmlQueryType.cs
- RotateTransform3D.cs
- EntityViewGenerator.cs
- SolidColorBrush.cs
- CodeRemoveEventStatement.cs
- XmlElementAttributes.cs
- CompiledRegexRunner.cs
- SqlBuffer.cs
- SqlTypeConverter.cs
- EditBehavior.cs
- ComEventsSink.cs
- HandlerMappingMemo.cs
- ControlBuilder.cs
- Object.cs
- TrackingParticipant.cs
- CaseInsensitiveHashCodeProvider.cs
- ConfigurationLoaderException.cs
- IntegerValidator.cs
- DecimalAverageAggregationOperator.cs
- ScriptingAuthenticationServiceSection.cs
- BaseValidator.cs
- InternalsVisibleToAttribute.cs
- ReferentialConstraintRoleElement.cs
- XmlWellformedWriter.cs
- ServicePoint.cs
- DesignBindingPicker.cs
- Win32.cs
- FileEnumerator.cs
- _ListenerRequestStream.cs
- IpcClientChannel.cs
- PrePrepareMethodAttribute.cs
- EdmValidator.cs
- DataGridViewRowCollection.cs
- MonthChangedEventArgs.cs
- Timer.cs
- NumericUpDownAcceleration.cs
- CodeNamespaceImport.cs
- HelpInfo.cs
- WindowsTokenRoleProvider.cs
- EmptyStringExpandableObjectConverter.cs
- ValidationPropertyAttribute.cs
- XamlFrame.cs
- XmlQualifiedName.cs
- Label.cs
- XPathNavigator.cs
- DataGridViewCellCancelEventArgs.cs
- MatcherBuilder.cs