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
- SystemSounds.cs
- Storyboard.cs
- MatrixAnimationUsingKeyFrames.cs
- UInt64Storage.cs
- CustomError.cs
- DataKey.cs
- AvTraceFormat.cs
- XmlSignatureManifest.cs
- OletxCommittableTransaction.cs
- WindowsToolbarAsMenu.cs
- WebUtil.cs
- NativeMethods.cs
- DataGridViewSortCompareEventArgs.cs
- IIS7WorkerRequest.cs
- WCFServiceClientProxyGenerator.cs
- SystemColors.cs
- HWStack.cs
- DocumentPageHost.cs
- AnnotationHighlightLayer.cs
- Signature.cs
- GatewayIPAddressInformationCollection.cs
- StaticContext.cs
- Floater.cs
- XmlSchemaAnyAttribute.cs
- EllipseGeometry.cs
- InvalidateEvent.cs
- CodeDirectiveCollection.cs
- IdnMapping.cs
- RenderTargetBitmap.cs
- ResourceBinder.cs
- DelegateTypeInfo.cs
- Tuple.cs
- ApplicationGesture.cs
- WebPartConnectVerb.cs
- ContentPosition.cs
- ObjectPersistData.cs
- DataGridViewColumnDesigner.cs
- DataSourceControl.cs
- EntityDataSourceWrapper.cs
- ParallelTimeline.cs
- relpropertyhelper.cs
- RestHandler.cs
- MailMessageEventArgs.cs
- DataObject.cs
- ConstructorBuilder.cs
- JavaScriptString.cs
- CodeDomExtensionMethods.cs
- UnsafeNativeMethods.cs
- DataGridColumnDropSeparator.cs
- MessageBox.cs
- EditorResources.cs
- ArraySortHelper.cs
- EventPropertyMap.cs
- NativeMethods.cs
- SerializationHelper.cs
- figurelength.cs
- SortKey.cs
- NativeMethods.cs
- Tracking.cs
- SettingsContext.cs
- SliderAutomationPeer.cs
- XmlValidatingReaderImpl.cs
- CompilerInfo.cs
- XmlSortKey.cs
- OutOfProcStateClientManager.cs
- XmlSchemaAttributeGroup.cs
- MsdtcWrapper.cs
- Win32.cs
- ValueProviderWrapper.cs
- EntityParameterCollection.cs
- EntityModelSchemaGenerator.cs
- HandlerFactoryWrapper.cs
- DbSourceParameterCollection.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- OverflowException.cs
- CodeSnippetTypeMember.cs
- WinOEToolBoxItem.cs
- DataBoundLiteralControl.cs
- WebPartEditVerb.cs
- OdbcDataAdapter.cs
- SchemaElementLookUpTable.cs
- Timer.cs
- AutomationElement.cs
- OperatingSystem.cs
- GlyphsSerializer.cs
- RegexRunner.cs
- XmlSchemaSet.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- MobileControlsSectionHandler.cs
- FloaterParaClient.cs
- HandlerMappingMemo.cs
- BitmapScalingModeValidation.cs
- WindowsListBox.cs
- CultureMapper.cs
- UnsafeNativeMethodsTablet.cs
- WebPartTransformer.cs
- TypeSource.cs
- PathTooLongException.cs
- GridViewDeletedEventArgs.cs
- TextTreeInsertElementUndoUnit.cs