Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 2 / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeSystem.cs
- WebPartUserCapability.cs
- RenderingEventArgs.cs
- XmlSchemaAttributeGroup.cs
- TransformPattern.cs
- CodeMemberField.cs
- ProcessHostMapPath.cs
- SqlGenericUtil.cs
- ActivityTypeCodeDomSerializer.cs
- EntityContainerEntitySet.cs
- FileLoadException.cs
- SqlHelper.cs
- FormViewRow.cs
- SmiSettersStream.cs
- StatusBarAutomationPeer.cs
- AttributeProviderAttribute.cs
- LinqDataSourceUpdateEventArgs.cs
- GiveFeedbackEventArgs.cs
- DataObjectAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- PropertyGridEditorPart.cs
- DesignTimeTemplateParser.cs
- UnauthorizedAccessException.cs
- DefaultParameterValueAttribute.cs
- Win32.cs
- MimeMultiPart.cs
- SlipBehavior.cs
- DbConnectionPoolIdentity.cs
- Rect.cs
- ThicknessKeyFrameCollection.cs
- DropDownButton.cs
- ImageBrush.cs
- ElementsClipboardData.cs
- TokenBasedSetEnumerator.cs
- SpecularMaterial.cs
- EntityCommandDefinition.cs
- StructuredType.cs
- HtmlInputImage.cs
- Encoding.cs
- Synchronization.cs
- CheckedListBox.cs
- ColumnMapCopier.cs
- ProvidersHelper.cs
- UpdatePanelTriggerCollection.cs
- Helpers.cs
- Exceptions.cs
- ValidationErrorCollection.cs
- EventLevel.cs
- BitmapEffectRenderDataResource.cs
- ParsedRoute.cs
- AdornedElementPlaceholder.cs
- Receive.cs
- TableLayoutStyle.cs
- EntityDataSourceViewSchema.cs
- FieldDescriptor.cs
- QuaternionConverter.cs
- ToolStripGripRenderEventArgs.cs
- IDictionary.cs
- TextServicesProperty.cs
- Optimizer.cs
- DataGridViewAccessibleObject.cs
- TypedDatasetGenerator.cs
- TextEditorCopyPaste.cs
- PrtTicket_Public_Simple.cs
- COAUTHINFO.cs
- UrlAuthorizationModule.cs
- Point3DIndependentAnimationStorage.cs
- FileSystemInfo.cs
- OptimalBreakSession.cs
- RowCache.cs
- CodeDomConfigurationHandler.cs
- Label.cs
- sqlnorm.cs
- MenuItemAutomationPeer.cs
- SpStreamWrapper.cs
- MarkupProperty.cs
- FlowPanelDesigner.cs
- WinCategoryAttribute.cs
- PaperSource.cs
- TransmissionStrategy.cs
- Padding.cs
- ReadOnlyPropertyMetadata.cs
- SocketInformation.cs
- MsmqTransportReceiveParameters.cs
- SignedPkcs7.cs
- indexingfiltermarshaler.cs
- Stackframe.cs
- ClientSettingsProvider.cs
- SymbolTable.cs
- Section.cs
- WebAdminConfigurationHelper.cs
- SqlTypeConverter.cs
- PropertyDescriptorCollection.cs
- HandledEventArgs.cs
- Parser.cs
- CollectionChangedEventManager.cs
- DashStyle.cs
- StaticFileHandler.cs
- HasCopySemanticsAttribute.cs
- ApplicationGesture.cs