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
- ThreadPool.cs
- SemanticResolver.cs
- SqlBuilder.cs
- RenderTargetBitmap.cs
- AddDataControlFieldDialog.cs
- FileDialogPermission.cs
- SystemColors.cs
- FilteredXmlReader.cs
- Inflater.cs
- ZoneButton.cs
- DBConcurrencyException.cs
- HwndSourceParameters.cs
- ToolboxItemAttribute.cs
- Tag.cs
- MatrixTransform.cs
- StylusDevice.cs
- HtmlTableCellCollection.cs
- ImpersonationContext.cs
- TextView.cs
- AssemblyInfo.cs
- FormsAuthentication.cs
- XmlText.cs
- ContentElement.cs
- DrawItemEvent.cs
- CharacterHit.cs
- GridViewEditEventArgs.cs
- BufferBuilder.cs
- RuleSettings.cs
- SafeEventLogWriteHandle.cs
- NamespaceCollection.cs
- UITypeEditor.cs
- TypeResolvingOptionsAttribute.cs
- PointKeyFrameCollection.cs
- DocumentXmlWriter.cs
- GraphicsPathIterator.cs
- UserPreferenceChangedEventArgs.cs
- StrongBox.cs
- CompressedStack.cs
- HttpCachePolicyWrapper.cs
- SqlTypesSchemaImporter.cs
- SelectionProviderWrapper.cs
- PlatformCulture.cs
- VScrollProperties.cs
- KeyGestureConverter.cs
- CommonXSendMessage.cs
- CodeDomSerializerBase.cs
- FilterElement.cs
- ClusterSafeNativeMethods.cs
- DummyDataSource.cs
- RelationshipConstraintValidator.cs
- EventHandlerList.cs
- PropertyContainer.cs
- BuildManager.cs
- RightsManagementPermission.cs
- SystemPens.cs
- SiteMembershipCondition.cs
- Mapping.cs
- Header.cs
- documentsequencetextpointer.cs
- IisTraceWebEventProvider.cs
- MethodCallConverter.cs
- DbDataRecord.cs
- ToolBarButton.cs
- DesignerTextBoxAdapter.cs
- wgx_sdk_version.cs
- MenuAdapter.cs
- WebPartManager.cs
- DataGridViewCellFormattingEventArgs.cs
- SemanticAnalyzer.cs
- CompositeDataBoundControl.cs
- __Filters.cs
- StyleBamlTreeBuilder.cs
- DataGridViewBand.cs
- PassportPrincipal.cs
- AuthenticationModulesSection.cs
- XmlSequenceWriter.cs
- TextElementEditingBehaviorAttribute.cs
- HtmlInputButton.cs
- SynchronizationValidator.cs
- KeyValueConfigurationElement.cs
- PartitionedStream.cs
- WeakReference.cs
- SID.cs
- SecurityDocument.cs
- TextLineBreak.cs
- Light.cs
- EventDescriptor.cs
- VariableQuery.cs
- ConnectionPointCookie.cs
- ContextMenuAutomationPeer.cs
- RawTextInputReport.cs
- CommentGlyph.cs
- SqlCaseSimplifier.cs
- InvalidOleVariantTypeException.cs
- CustomErrorCollection.cs
- AsymmetricKeyExchangeFormatter.cs
- UInt16Converter.cs
- MessageTransmitTraceRecord.cs
- FtpRequestCacheValidator.cs
- PageParser.cs