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
- CryptoConfig.cs
- SolidColorBrush.cs
- MemoryFailPoint.cs
- SystemPens.cs
- LongValidator.cs
- EmptyEnumerator.cs
- BaseInfoTable.cs
- BinaryReader.cs
- DataGridViewTopRowAccessibleObject.cs
- EnterpriseServicesHelper.cs
- DetailsViewPageEventArgs.cs
- GeometryGroup.cs
- Annotation.cs
- ThrowHelper.cs
- Font.cs
- ErrorInfoXmlDocument.cs
- OleDbException.cs
- UnsafeNativeMethodsCLR.cs
- ActivityDesignerHelper.cs
- SecurityCriticalDataForSet.cs
- RegexParser.cs
- CodeObject.cs
- FixedDSBuilder.cs
- FixedSOMFixedBlock.cs
- WebServiceErrorEvent.cs
- SendKeys.cs
- _AutoWebProxyScriptWrapper.cs
- JoinElimination.cs
- TimeSpanValidatorAttribute.cs
- TemplatedAdorner.cs
- ObjectListDesigner.cs
- WebException.cs
- PrivilegedConfigurationManager.cs
- IndependentlyAnimatedPropertyMetadata.cs
- EditorZoneBase.cs
- SafeFindHandle.cs
- XamlReaderHelper.cs
- NopReturnReader.cs
- ProviderException.cs
- XmlCountingReader.cs
- FileStream.cs
- PageCanvasSize.cs
- SystemIPGlobalStatistics.cs
- Gdiplus.cs
- CngUIPolicy.cs
- CollectionContainer.cs
- BaseHashHelper.cs
- AppDomainUnloadedException.cs
- TextLine.cs
- Visual3DCollection.cs
- TimelineClockCollection.cs
- XpsLiterals.cs
- SystemWebSectionGroup.cs
- Activator.cs
- IUnknownConstantAttribute.cs
- ScaleTransform3D.cs
- ResXBuildProvider.cs
- VSWCFServiceContractGenerator.cs
- MarkupExtensionParser.cs
- JpegBitmapDecoder.cs
- DataGridViewCellParsingEventArgs.cs
- BitmapPalettes.cs
- SecurityCriticalDataForSet.cs
- StringExpressionSet.cs
- OdbcConnectionString.cs
- StringValidator.cs
- QueryCacheKey.cs
- XsdCachingReader.cs
- ContractListAdapter.cs
- Selector.cs
- BinaryNode.cs
- designeractionbehavior.cs
- MediaElementAutomationPeer.cs
- XsltOutput.cs
- RequiredFieldValidator.cs
- ProcessThread.cs
- CodeDOMUtility.cs
- InputMethod.cs
- SharedPersonalizationStateInfo.cs
- CodeThrowExceptionStatement.cs
- MetaForeignKeyColumn.cs
- InstanceLockLostException.cs
- PropertiesTab.cs
- CatchBlock.cs
- DataContractSet.cs
- XsltOutput.cs
- Vector.cs
- ServiceInfo.cs
- _StreamFramer.cs
- StructuredTypeInfo.cs
- CompilerError.cs
- ZoneMembershipCondition.cs
- FixedSOMTableRow.cs
- RelationHandler.cs
- SettingsPropertyWrongTypeException.cs
- DiscoveryEndpointElement.cs
- ProviderConnectionPoint.cs
- StretchValidation.cs
- ProcessHost.cs
- ToolStripSeparator.cs