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
- PrintingPermission.cs
- ClientTargetCollection.cs
- InvalidEnumArgumentException.cs
- OLEDB_Util.cs
- BufferedStream.cs
- Matrix.cs
- Command.cs
- CodeGeneratorOptions.cs
- SqlDataSourceCache.cs
- Win32Native.cs
- PerfService.cs
- DataColumnChangeEvent.cs
- TextEditor.cs
- Constraint.cs
- DateTimeConstantAttribute.cs
- DetailsViewInsertedEventArgs.cs
- DynamicDataRoute.cs
- BrowserTree.cs
- SafeReversePInvokeHandle.cs
- WebPartConnectionsCancelEventArgs.cs
- GeneralTransformGroup.cs
- CommunicationObjectAbortedException.cs
- TagMapCollection.cs
- SemanticAnalyzer.cs
- _DomainName.cs
- PointLightBase.cs
- SerialPort.cs
- ModelItemImpl.cs
- GeometryCombineModeValidation.cs
- FillErrorEventArgs.cs
- InkCanvasAutomationPeer.cs
- InputLanguageCollection.cs
- DataColumnChangeEvent.cs
- PagedControl.cs
- DataColumnMapping.cs
- StylusEventArgs.cs
- SystemGatewayIPAddressInformation.cs
- Collection.cs
- MsmqNonTransactedPoisonHandler.cs
- AnimationStorage.cs
- ColorIndependentAnimationStorage.cs
- RTLAwareMessageBox.cs
- PrintPageEvent.cs
- TriggerBase.cs
- FileLevelControlBuilderAttribute.cs
- DetailsViewRow.cs
- WorkflowQueue.cs
- FormView.cs
- CompModSwitches.cs
- EventOpcode.cs
- ViewBox.cs
- XmlNode.cs
- CommandBindingCollection.cs
- TypeBrowser.xaml.cs
- FullTextLine.cs
- TransformPattern.cs
- ClearTypeHintValidation.cs
- SwitchAttribute.cs
- BrowserCapabilitiesFactoryBase.cs
- ExecutionPropertyManager.cs
- PolyQuadraticBezierSegment.cs
- ElementHost.cs
- PkcsMisc.cs
- CollectionChange.cs
- Clock.cs
- DebugView.cs
- StoryFragments.cs
- LambdaCompiler.Lambda.cs
- SerializerDescriptor.cs
- ImageCodecInfoPrivate.cs
- VerificationException.cs
- UnsafeNativeMethods.cs
- TransformerInfoCollection.cs
- __Filters.cs
- EntityDataSourceDataSelectionPanel.cs
- Point3DAnimation.cs
- DelayedRegex.cs
- AssemblySettingAttributes.cs
- TypeToken.cs
- Int32RectConverter.cs
- PerformanceCounterCategory.cs
- OleDbWrapper.cs
- ResourcePermissionBaseEntry.cs
- WebServiceAttribute.cs
- MatrixTransform.cs
- WorkflowRuntimeServiceElement.cs
- KeySplineConverter.cs
- DocumentPageTextView.cs
- UnionCodeGroup.cs
- HashHelper.cs
- PropertyDescriptor.cs
- FontWeightConverter.cs
- X509UI.cs
- XmlTextWriter.cs
- _StreamFramer.cs
- FormsAuthenticationUserCollection.cs
- IntSecurity.cs
- TransformGroup.cs
- ContractMapping.cs
- FormViewUpdateEventArgs.cs