Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 1305376 / 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
- CompoundFileReference.cs
- RichTextBoxAutomationPeer.cs
- HttpPostProtocolImporter.cs
- OpenTypeCommon.cs
- TableHeaderCell.cs
- DataSetMappper.cs
- FileDataSourceCache.cs
- StylusButton.cs
- ObjectDataSource.cs
- ImageFormat.cs
- ADMembershipProvider.cs
- IsolatedStorageFileStream.cs
- BamlCollectionHolder.cs
- HandlerBase.cs
- FileEnumerator.cs
- Helpers.cs
- FrameDimension.cs
- DataGridViewAddColumnDialog.cs
- CorrelationActionMessageFilter.cs
- PackUriHelper.cs
- DocumentCollection.cs
- CodeTypeParameterCollection.cs
- MultiSelectRootGridEntry.cs
- WebErrorHandler.cs
- BypassElementCollection.cs
- SecureConversationDriver.cs
- EntityTypeEmitter.cs
- IndexedString.cs
- ValidationError.cs
- WindowsAuthenticationModule.cs
- figurelength.cs
- WebConfigurationHostFileChange.cs
- sapiproxy.cs
- XsdDateTime.cs
- FilterEventArgs.cs
- CriticalFinalizerObject.cs
- XamlFigureLengthSerializer.cs
- KeyConstraint.cs
- Executor.cs
- ExternalFile.cs
- EventDescriptorCollection.cs
- ReadOnlyDictionary.cs
- DataGridViewCellMouseEventArgs.cs
- ImmComposition.cs
- OrderedEnumerableRowCollection.cs
- PageFunction.cs
- SoundPlayer.cs
- MessageDesigner.cs
- StackSpiller.Temps.cs
- ListDataBindEventArgs.cs
- DirectionalLight.cs
- SizeKeyFrameCollection.cs
- TransactionFilter.cs
- XslTransform.cs
- CustomErrorsSection.cs
- ConfigurationManagerInternalFactory.cs
- X509Certificate.cs
- ReceiveCompletedEventArgs.cs
- Compiler.cs
- WindowsFormsSectionHandler.cs
- DataGridAddNewRow.cs
- FontDialog.cs
- TextCompositionEventArgs.cs
- MetadataExporter.cs
- TypeContext.cs
- DragSelectionMessageFilter.cs
- BeginGetFileNameFromUserRequest.cs
- Path.cs
- LinearKeyFrames.cs
- BinaryObjectInfo.cs
- OracleTimeSpan.cs
- ToolStripGrip.cs
- LinqToSqlWrapper.cs
- Config.cs
- CodeNamespaceCollection.cs
- WebScriptMetadataMessageEncoderFactory.cs
- EntityEntry.cs
- InstanceDataCollectionCollection.cs
- RawStylusInput.cs
- IgnoreSectionHandler.cs
- LayoutEvent.cs
- MenuItemBinding.cs
- XmlResolver.cs
- QueryTask.cs
- ObjectDataSourceStatusEventArgs.cs
- MatrixKeyFrameCollection.cs
- SqlUDTStorage.cs
- PnrpPeerResolverElement.cs
- DefaultValueAttribute.cs
- ColorInterpolationModeValidation.cs
- storepermissionattribute.cs
- SynchronousChannelMergeEnumerator.cs
- BitmapEncoder.cs
- Clause.cs
- WizardStepBase.cs
- DataGridItemEventArgs.cs
- DataGridViewHeaderCell.cs
- Token.cs
- Transform3DGroup.cs
- ActivityDesignerAccessibleObject.cs