Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / PostBackTrigger.cs / 1305376 / 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.Web;
using System.Web.UI;
using System.Web.Resources;
using System.Web.Util;
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
- TraceSection.cs
- XhtmlBasicPhoneCallAdapter.cs
- ComboBoxRenderer.cs
- XamlStream.cs
- DataServiceQueryException.cs
- GeneralTransform3D.cs
- SessionPageStateSection.cs
- TypeInfo.cs
- HostSecurityManager.cs
- ZipPackagePart.cs
- TraceListeners.cs
- ArraySegment.cs
- DoubleCollectionConverter.cs
- MsmqIntegrationSecurityElement.cs
- RoleGroup.cs
- _IPv4Address.cs
- RemoteWebConfigurationHostServer.cs
- DataBindEngine.cs
- RowTypeElement.cs
- AssociationSetMetadata.cs
- ProfileEventArgs.cs
- XamlPointCollectionSerializer.cs
- WsdlInspector.cs
- Zone.cs
- CallSiteOps.cs
- PowerEase.cs
- HttpAsyncResult.cs
- XhtmlConformanceSection.cs
- AstTree.cs
- XmlIgnoreAttribute.cs
- RectangleConverter.cs
- WindowAutomationPeer.cs
- StringConverter.cs
- Image.cs
- ListInitExpression.cs
- XmlSchemaAttributeGroupRef.cs
- TimeSpanValidator.cs
- CapabilitiesUse.cs
- listitem.cs
- Facet.cs
- ToolboxItem.cs
- AbsoluteQuery.cs
- WindowsRegion.cs
- ChangesetResponse.cs
- PresentationAppDomainManager.cs
- AudioDeviceOut.cs
- Primitive.cs
- SqlServices.cs
- SortedDictionary.cs
- Pts.cs
- ClosableStream.cs
- OneToOneMappingSerializer.cs
- WebPartManagerInternals.cs
- GZipDecoder.cs
- PropertyRef.cs
- ItemsControlAutomationPeer.cs
- SevenBitStream.cs
- GlobalEventManager.cs
- WebService.cs
- SqlErrorCollection.cs
- CacheSection.cs
- ProfileEventArgs.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- TextFormatterContext.cs
- basenumberconverter.cs
- ToolboxItemImageConverter.cs
- GradientStop.cs
- InvokePatternIdentifiers.cs
- RSACryptoServiceProvider.cs
- IdentityElement.cs
- ConfigXmlAttribute.cs
- StorageEntityTypeMapping.cs
- ListSortDescription.cs
- Encoder.cs
- ImmutableDispatchRuntime.cs
- TextAction.cs
- PersonalizationProviderHelper.cs
- CheckStoreFileValidityRequest.cs
- StringUtil.cs
- SupportsEventValidationAttribute.cs
- TextEffectResolver.cs
- HashCodeCombiner.cs
- FixedPageProcessor.cs
- UIElementParagraph.cs
- CompilerParameters.cs
- DataGridViewColumnDesigner.cs
- HttpModuleActionCollection.cs
- Helper.cs
- CodeObject.cs
- LinqDataSourceHelper.cs
- GlobalizationAssembly.cs
- XmlNodeList.cs
- Boolean.cs
- ReadWriteObjectLock.cs
- AsyncCompletedEventArgs.cs
- ControlCodeDomSerializer.cs
- TypeConverterAttribute.cs
- ScheduleChanges.cs
- SymbolType.cs
- _HTTPDateParse.cs