Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- PersistChildrenAttribute.cs
- BigInt.cs
- ObfuscateAssemblyAttribute.cs
- DecimalStorage.cs
- DiscardableAttribute.cs
- NativeMethods.cs
- PointCollectionValueSerializer.cs
- TypedReference.cs
- OutputCacheSection.cs
- PngBitmapEncoder.cs
- ListControlStringCollectionEditor.cs
- PreservationFileReader.cs
- MarginCollapsingState.cs
- DeviceFilterDictionary.cs
- AuthenticationConfig.cs
- FamilyCollection.cs
- CustomCategoryAttribute.cs
- AssertSection.cs
- LocalizedNameDescriptionPair.cs
- FtpCachePolicyElement.cs
- AuthenticationException.cs
- RequestCachingSection.cs
- ConstructorNeedsTagAttribute.cs
- PropertyCondition.cs
- LiteralControl.cs
- ValueExpressions.cs
- ExceptionRoutedEventArgs.cs
- unsafenativemethodstextservices.cs
- ValueHandle.cs
- _CacheStreams.cs
- StylusPointPropertyId.cs
- Exceptions.cs
- SortDescription.cs
- CodeStatementCollection.cs
- DefaultBindingPropertyAttribute.cs
- IPEndPointCollection.cs
- TypeToArgumentTypeConverter.cs
- QueryableDataSourceView.cs
- TypedTableHandler.cs
- SessionIDManager.cs
- DateTimeConverter2.cs
- Attributes.cs
- RadioButton.cs
- ColorConvertedBitmap.cs
- Int32AnimationUsingKeyFrames.cs
- SchemaEntity.cs
- BitmapEffect.cs
- BitmapEffectInput.cs
- DiscoveryClientProtocol.cs
- DataServiceQueryProvider.cs
- ContextMenuAutomationPeer.cs
- SystemWebSectionGroup.cs
- WorkflowElementDialog.cs
- TextTreeTextBlock.cs
- PageAdapter.cs
- PDBReader.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ProcessMonitor.cs
- SvcMapFile.cs
- RadioButton.cs
- LockCookie.cs
- URIFormatException.cs
- KoreanLunisolarCalendar.cs
- InputProcessorProfiles.cs
- DefaultObjectMappingItemCollection.cs
- CollectionViewSource.cs
- EarlyBoundInfo.cs
- TypeCollectionPropertyEditor.cs
- PasswordPropertyTextAttribute.cs
- VScrollProperties.cs
- AutoCompleteStringCollection.cs
- PropertyMetadata.cs
- ImageSourceValueSerializer.cs
- ListBoxItem.cs
- SafeSecurityHandles.cs
- ConfigurationPermission.cs
- PrintDocument.cs
- ListBox.cs
- TableDetailsCollection.cs
- ProbeMatchesMessageCD1.cs
- VersionValidator.cs
- ThemeDictionaryExtension.cs
- AnonymousIdentificationSection.cs
- LinkArea.cs
- Encoder.cs
- ContentHostHelper.cs
- HttpHandler.cs
- BorderSidesEditor.cs
- PageParserFilter.cs
- MatrixKeyFrameCollection.cs
- HostedController.cs
- TypedAsyncResult.cs
- CollectionChangeEventArgs.cs
- SoapReflectionImporter.cs
- Popup.cs
- InputMethodStateTypeInfo.cs
- SqlBuffer.cs
- ExpandCollapsePattern.cs
- SafeProcessHandle.cs
- DataGridViewRowPrePaintEventArgs.cs