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
- ObjectHandle.cs
- DrawingContext.cs
- TextWriter.cs
- EncoderReplacementFallback.cs
- IHttpResponseInternal.cs
- NotConverter.cs
- SecurityAppliedMessage.cs
- LinkConverter.cs
- SequenceNumber.cs
- UIElementAutomationPeer.cs
- PrintControllerWithStatusDialog.cs
- CheckBoxBaseAdapter.cs
- DataMemberListEditor.cs
- CancellationHandlerDesigner.cs
- MenuScrollingVisibilityConverter.cs
- RemotingService.cs
- TextParagraph.cs
- ExpressionLink.cs
- QilCloneVisitor.cs
- GridViewColumnCollectionChangedEventArgs.cs
- FactoryRecord.cs
- DesignUtil.cs
- DoubleSumAggregationOperator.cs
- PointIndependentAnimationStorage.cs
- TdsEnums.cs
- BlobPersonalizationState.cs
- XmlSerializerFactory.cs
- SelectedGridItemChangedEvent.cs
- ToolBarButtonClickEvent.cs
- CriticalExceptions.cs
- HtmlGenericControl.cs
- GZipStream.cs
- OdbcReferenceCollection.cs
- SafeMILHandle.cs
- Globals.cs
- PropertyDescriptorCollection.cs
- TextRangeEdit.cs
- AnyReturnReader.cs
- DataGridViewRowCollection.cs
- SecurityTokenSpecification.cs
- ToolStripOverflowButton.cs
- AuthenticationException.cs
- FormViewInsertEventArgs.cs
- CommandLineParser.cs
- ScrollPatternIdentifiers.cs
- BindStream.cs
- ElapsedEventArgs.cs
- WindowsTitleBar.cs
- NavigationWindowAutomationPeer.cs
- EditorZoneBase.cs
- XsltOutput.cs
- DataGridViewImageCell.cs
- SchemaType.cs
- HttpListenerContext.cs
- CallbackValidatorAttribute.cs
- WizardSideBarListControlItemEventArgs.cs
- OperatorExpressions.cs
- ObjectDesignerDataSourceView.cs
- SaveFileDialog.cs
- NullExtension.cs
- DataGridViewAccessibleObject.cs
- SerialReceived.cs
- DataGridViewCellLinkedList.cs
- UrlAuthFailureHandler.cs
- SmtpCommands.cs
- DoubleLink.cs
- SerializationUtility.cs
- ColumnMapProcessor.cs
- GetKeyedHashRequest.cs
- IODescriptionAttribute.cs
- WebPartConnectionsCancelVerb.cs
- ExitEventArgs.cs
- ExtenderProviderService.cs
- SectionRecord.cs
- BinaryMessageFormatter.cs
- InputBindingCollection.cs
- OracleRowUpdatedEventArgs.cs
- FeatureAttribute.cs
- MergeLocalizationDirectives.cs
- DataGridViewColumnDesigner.cs
- CancellationTokenSource.cs
- ToolTipService.cs
- SchemaObjectWriter.cs
- RawStylusSystemGestureInputReport.cs
- TextureBrush.cs
- SchemaSetCompiler.cs
- FileIOPermission.cs
- SystemIPInterfaceProperties.cs
- BaseParser.cs
- DataServiceHostFactory.cs
- ToolBar.cs
- _NegoStream.cs
- XmlQualifiedName.cs
- XmlSigningNodeWriter.cs
- HtmlToClrEventProxy.cs
- DbParameterHelper.cs
- HuffmanTree.cs
- ListBoxAutomationPeer.cs
- StatusBarPanelClickEvent.cs
- ImageFormatConverter.cs