Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 1 / DataControlImageButton.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of ImageButton used within a DataControl. /// [SupportsEventValidation] internal sealed class DataControlImageButton : ImageButton { IPostBackContainer _container; string _callbackArgument; bool _enableCallback; internal DataControlImageButton(IPostBackContainer container) { _container = container; } public override bool CausesValidation { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.CannotSetValidationOnDataControlButtons)); } } internal void EnableCallback(string argument) { _enableCallback = true; _callbackArgument = argument; } protected sealed override PostBackOptions GetPostBackOptions() { if (_container != null) { return _container.GetPostBackOptions(this); } return base.GetPostBackOptions(); } protected internal override void Render(HtmlTextWriter writer) { SetCallbackProperties(); base.Render(writer); } private void SetCallbackProperties() { if (_enableCallback) { ICallbackContainer _callbackContainer = _container as ICallbackContainer; if (_callbackContainer != null) { string callbackScript = _callbackContainer.GetCallbackScript(this, _callbackArgument); if (!String.IsNullOrEmpty(callbackScript)) { this.OnClientClick = callbackScript; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of ImageButton used within a DataControl. /// [SupportsEventValidation] internal sealed class DataControlImageButton : ImageButton { IPostBackContainer _container; string _callbackArgument; bool _enableCallback; internal DataControlImageButton(IPostBackContainer container) { _container = container; } public override bool CausesValidation { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.CannotSetValidationOnDataControlButtons)); } } internal void EnableCallback(string argument) { _enableCallback = true; _callbackArgument = argument; } protected sealed override PostBackOptions GetPostBackOptions() { if (_container != null) { return _container.GetPostBackOptions(this); } return base.GetPostBackOptions(); } protected internal override void Render(HtmlTextWriter writer) { SetCallbackProperties(); base.Render(writer); } private void SetCallbackProperties() { if (_enableCallback) { ICallbackContainer _callbackContainer = _container as ICallbackContainer; if (_callbackContainer != null) { string callbackScript = _callbackContainer.GetCallbackScript(this, _callbackArgument); if (!String.IsNullOrEmpty(callbackScript)) { this.OnClientClick = callbackScript; } } } } } } // 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
- TextCollapsingProperties.cs
- WorkflowViewElement.cs
- PointLight.cs
- Freezable.cs
- LoginStatusDesigner.cs
- PointIndependentAnimationStorage.cs
- SqlInternalConnection.cs
- ConstantCheck.cs
- altserialization.cs
- WebPartUserCapability.cs
- ConsumerConnectionPoint.cs
- DesignSurfaceEvent.cs
- UnmanagedMemoryStream.cs
- Panel.cs
- TextEditorThreadLocalStore.cs
- ColorPalette.cs
- PrintEvent.cs
- PageCatalogPart.cs
- NativeMethods.cs
- AssemblyName.cs
- EncryptedPackageFilter.cs
- TypeSystem.cs
- TextBox.cs
- SecurityRequiresReviewAttribute.cs
- CdpEqualityComparer.cs
- RootBrowserWindowAutomationPeer.cs
- ChannelManager.cs
- CompleteWizardStep.cs
- SafeMILHandle.cs
- SessionPageStatePersister.cs
- StrokeRenderer.cs
- SaveFileDialog.cs
- TreeNode.cs
- RolePrincipal.cs
- QuadraticBezierSegment.cs
- ConnectionsZone.cs
- DataGridViewColumnEventArgs.cs
- KeySplineConverter.cs
- XmlRootAttribute.cs
- BroadcastEventHelper.cs
- Update.cs
- returneventsaver.cs
- Storyboard.cs
- PackWebRequestFactory.cs
- DropShadowBitmapEffect.cs
- SHA1.cs
- XamlInterfaces.cs
- XmlSchemaGroupRef.cs
- DiscoveryClientOutputChannel.cs
- PromptEventArgs.cs
- SmiEventSink_DeferedProcessing.cs
- RowType.cs
- SQLBinary.cs
- HttpStaticObjectsCollectionBase.cs
- EncodingFallbackAwareXmlTextWriter.cs
- HwndSource.cs
- ListDataHelper.cs
- ComplexType.cs
- VersionedStream.cs
- _AutoWebProxyScriptWrapper.cs
- WebConfigurationFileMap.cs
- PatternMatcher.cs
- HashLookup.cs
- TextRunCacheImp.cs
- ProvidePropertyAttribute.cs
- BooleanFunctions.cs
- Base64Encoder.cs
- Graphics.cs
- CalloutQueueItem.cs
- BinaryConverter.cs
- IChannel.cs
- ComAdminInterfaces.cs
- DataTransferEventArgs.cs
- ShortcutKeysEditor.cs
- FillRuleValidation.cs
- ClientCultureInfo.cs
- CommandExpr.cs
- RemotingAttributes.cs
- SerializationSectionGroup.cs
- SHA384Managed.cs
- SchemaInfo.cs
- SizeChangedEventArgs.cs
- TripleDES.cs
- Hyperlink.cs
- CallbackException.cs
- View.cs
- ClockGroup.cs
- VisualBrush.cs
- ImageInfo.cs
- CategoryAttribute.cs
- AttributeInfo.cs
- BindingContext.cs
- ProgressiveCrcCalculatingStream.cs
- ConfigLoader.cs
- CacheOutputQuery.cs
- HttpWebResponse.cs
- AutomationEvent.cs
- ControlOperationBehavior.cs
- FrameDimension.cs
- VariableQuery.cs