Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InternalBufferOverflowException.cs
- ParseElementCollection.cs
- Condition.cs
- DataGridViewRowPostPaintEventArgs.cs
- ApplicationActivator.cs
- DateTime.cs
- XmlAttributeHolder.cs
- QueryStringParameter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- PrePostDescendentsWalker.cs
- ImplicitInputBrush.cs
- X509CertificateValidationMode.cs
- ServerValidateEventArgs.cs
- KeyValueConfigurationCollection.cs
- RoutedCommand.cs
- EventProviderTraceListener.cs
- ObjectTag.cs
- ThemeInfoAttribute.cs
- Page.cs
- Qualifier.cs
- RtfFormatStack.cs
- TreeNodeBinding.cs
- DockingAttribute.cs
- CodeDirectiveCollection.cs
- HttpHandlerActionCollection.cs
- ListBindingConverter.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- PresentationAppDomainManager.cs
- BindingCollection.cs
- QilReference.cs
- MultipleViewProviderWrapper.cs
- SqlCommandSet.cs
- SiteIdentityPermission.cs
- Tuple.cs
- HandlerBase.cs
- SelectManyQueryOperator.cs
- BaseCollection.cs
- StateItem.cs
- XmlIlVisitor.cs
- ExceptionUtil.cs
- FormsAuthenticationConfiguration.cs
- SystemFonts.cs
- CheckableControlBaseAdapter.cs
- SqlHelper.cs
- LexicalChunk.cs
- LockRecoveryTask.cs
- QilName.cs
- EntitySetBaseCollection.cs
- ListViewInsertedEventArgs.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- SMSvcHost.cs
- FixedSOMLineCollection.cs
- XmlCustomFormatter.cs
- SecurityCriticalDataForSet.cs
- DataExpression.cs
- AudioLevelUpdatedEventArgs.cs
- WinEventHandler.cs
- XPathPatternBuilder.cs
- ContextStack.cs
- GeometryHitTestParameters.cs
- AesCryptoServiceProvider.cs
- DependentList.cs
- LeafCellTreeNode.cs
- XmlNodeReader.cs
- ProgressiveCrcCalculatingStream.cs
- AttributeTable.cs
- VisualProxy.cs
- List.cs
- SmtpAuthenticationManager.cs
- Graphics.cs
- XmlSchemaChoice.cs
- Permission.cs
- JsonReader.cs
- DesignerOptionService.cs
- StatusBarDrawItemEvent.cs
- X509Certificate.cs
- UIInitializationException.cs
- CacheDependency.cs
- TouchEventArgs.cs
- NotSupportedException.cs
- PrintingPermission.cs
- TypeLoadException.cs
- ValidationSummary.cs
- LifetimeServices.cs
- SerializationStore.cs
- SspiSafeHandles.cs
- ComplusTypeValidator.cs
- DefaultTextStoreTextComposition.cs
- DictionaryEntry.cs
- MemoryFailPoint.cs
- ChangeProcessor.cs
- AuthenticationModuleElement.cs
- ComponentCommands.cs
- HttpHeaderCollection.cs
- XsltCompileContext.cs
- VisualStyleTypesAndProperties.cs
- StateMachineSubscription.cs
- SafeMILHandle.cs
- FixedDSBuilder.cs
- XmlSchemaInferenceException.cs