Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- WebBaseEventKeyComparer.cs
- CaseCqlBlock.cs
- ConcurrencyBehavior.cs
- TreeViewEvent.cs
- QueryOutputWriter.cs
- XmlDocumentFragment.cs
- CommonProperties.cs
- HandlerFactoryCache.cs
- ForwardPositionQuery.cs
- AccessDataSourceView.cs
- TemplateBindingExtension.cs
- ListControlConvertEventArgs.cs
- FixedTextView.cs
- FileNotFoundException.cs
- ToolZone.cs
- LoginCancelEventArgs.cs
- XmlCompatibilityReader.cs
- DesignerSerializationOptionsAttribute.cs
- ThemeableAttribute.cs
- RSAOAEPKeyExchangeFormatter.cs
- IOException.cs
- CustomDictionarySources.cs
- GeneralTransform.cs
- DBSqlParserTable.cs
- AesCryptoServiceProvider.cs
- SymmetricAlgorithm.cs
- MetadataProperty.cs
- ExpressionConverter.cs
- SimpleType.cs
- ReverseInheritProperty.cs
- SqlDataSource.cs
- LinkTarget.cs
- XmlSchemaAny.cs
- MenuEventArgs.cs
- DataControlPagerLinkButton.cs
- EventLogTraceListener.cs
- SelectionHighlightInfo.cs
- FilterableAttribute.cs
- StreamGeometry.cs
- SafeCryptContextHandle.cs
- ToolStripDropDownDesigner.cs
- IsolatedStoragePermission.cs
- InheritanceRules.cs
- WebPartMenuStyle.cs
- SiteMapNodeItemEventArgs.cs
- SmiContextFactory.cs
- ReflectPropertyDescriptor.cs
- LocatorPart.cs
- ChtmlLinkAdapter.cs
- WebPartDisplayMode.cs
- ProcessModuleCollection.cs
- LineBreak.cs
- SafeMILHandle.cs
- DmlSqlGenerator.cs
- TabRenderer.cs
- DBSqlParserTableCollection.cs
- ObservableCollection.cs
- ToolStripPanel.cs
- ConnectionPointCookie.cs
- SchemaTypeEmitter.cs
- SourceSwitch.cs
- TTSEngineTypes.cs
- ByteAnimation.cs
- SimpleHandlerFactory.cs
- RevocationPoint.cs
- FontConverter.cs
- ToolboxItemFilterAttribute.cs
- WebSysDisplayNameAttribute.cs
- HostSecurityManager.cs
- ScriptResourceInfo.cs
- MemberNameValidator.cs
- ReachDocumentReferenceCollectionSerializer.cs
- HostedTransportConfigurationBase.cs
- DataControlFieldCell.cs
- IsolationInterop.cs
- PtsCache.cs
- DbProviderFactoriesConfigurationHandler.cs
- DocumentPaginator.cs
- EntitySqlQueryCacheEntry.cs
- ToolStripDropDown.cs
- RadioButtonPopupAdapter.cs
- PerformanceCountersElement.cs
- XmlResolver.cs
- ContractReference.cs
- EncodingInfo.cs
- ResourceExpressionEditorSheet.cs
- ChangeProcessor.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- WeakReadOnlyCollection.cs
- Durable.cs
- BitmapEffectInputData.cs
- EncoderReplacementFallback.cs
- BuildProvider.cs
- RoutedPropertyChangedEventArgs.cs
- MdiWindowListStrip.cs
- InkCanvas.cs
- HttpListener.cs
- CLRBindingWorker.cs
- FilteredDataSetHelper.cs
- TextEditorThreadLocalStore.cs