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
- RuleSettings.cs
- Trace.cs
- HttpPostClientProtocol.cs
- ImageAttributes.cs
- ObjectListFieldsPage.cs
- ValueHandle.cs
- IFormattable.cs
- Exceptions.cs
- VectorAnimationUsingKeyFrames.cs
- BitmapSourceSafeMILHandle.cs
- ScrollChangedEventArgs.cs
- ObjectConverter.cs
- WindowsGraphics2.cs
- SrgsDocument.cs
- ToolStripItem.cs
- WebResponse.cs
- CompressStream.cs
- TrackingProfileDeserializationException.cs
- MessageDirection.cs
- SchemaImporter.cs
- NumberAction.cs
- WindowsEditBoxRange.cs
- XmlCharType.cs
- UriParserTemplates.cs
- LingerOption.cs
- CounterSampleCalculator.cs
- ImageAnimator.cs
- HuffCodec.cs
- DataContractSerializerOperationFormatter.cs
- DataColumnMapping.cs
- UserControl.cs
- SettingsBase.cs
- DetailsViewInsertedEventArgs.cs
- ComEventsMethod.cs
- DataGridViewCellValidatingEventArgs.cs
- InternalsVisibleToAttribute.cs
- CodeDelegateCreateExpression.cs
- Pen.cs
- UnsafeNativeMethods.cs
- SimpleExpression.cs
- PtsHost.cs
- StaticSiteMapProvider.cs
- AssemblyInfo.cs
- IpcPort.cs
- GifBitmapEncoder.cs
- XslTransform.cs
- PagePropertiesChangingEventArgs.cs
- ConfigXmlText.cs
- JapaneseCalendar.cs
- shaperfactoryquerycachekey.cs
- DocumentReferenceCollection.cs
- EditorOptionAttribute.cs
- RangeValidator.cs
- InputLanguage.cs
- TagNameToTypeMapper.cs
- CursorEditor.cs
- BStrWrapper.cs
- SchemaElement.cs
- BitmapEffectInput.cs
- PageStatePersister.cs
- UnsafeNativeMethodsTablet.cs
- RestClientProxyHandler.cs
- QuerySettings.cs
- HtmlFormWrapper.cs
- MethodCallConverter.cs
- DialogResultConverter.cs
- MessageFilter.cs
- XmlSchemaObjectTable.cs
- InheritanceAttribute.cs
- InputScopeAttribute.cs
- StylusShape.cs
- OrderingExpression.cs
- StylusPlugInCollection.cs
- FunctionMappingTranslator.cs
- XmlnsDictionary.cs
- Evidence.cs
- ErrorsHelper.cs
- EncoderParameter.cs
- StreamInfo.cs
- Cell.cs
- CursorInteropHelper.cs
- FileUpload.cs
- HttpWebRequestElement.cs
- SynchronizedDispatch.cs
- DispatcherOperation.cs
- HyperLinkStyle.cs
- DataGridViewBindingCompleteEventArgs.cs
- SeekStoryboard.cs
- SudsWriter.cs
- Byte.cs
- ListViewInsertedEventArgs.cs
- VariableQuery.cs
- ScriptReferenceBase.cs
- SystemUdpStatistics.cs
- MapPathBasedVirtualPathProvider.cs
- Button.cs
- RotateTransform3D.cs
- XmlSchemaException.cs
- QueryableDataSourceEditData.cs
- SecureEnvironment.cs