Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HashHelper.cs
- SetterBaseCollection.cs
- ResourceDisplayNameAttribute.cs
- AudioFormatConverter.cs
- GeometryCombineModeValidation.cs
- ServiceOperationParameter.cs
- SchemaNames.cs
- FilterEventArgs.cs
- AbandonedMutexException.cs
- FaultHandlingFilter.cs
- CanonicalFontFamilyReference.cs
- DetailsViewCommandEventArgs.cs
- ZoneLinkButton.cs
- CancelEventArgs.cs
- ImageCodecInfo.cs
- TrustLevelCollection.cs
- ParameterModifier.cs
- TableRowGroup.cs
- ConfigLoader.cs
- TextEditorTyping.cs
- ReaderWriterLockSlim.cs
- EventLog.cs
- XmlReflectionImporter.cs
- SortFieldComparer.cs
- Codec.cs
- BasicBrowserDialog.cs
- NodeLabelEditEvent.cs
- ElementUtil.cs
- LateBoundChannelParameterCollection.cs
- Partitioner.cs
- Scene3D.cs
- TransformCollection.cs
- ValidatingReaderNodeData.cs
- AppDomainProtocolHandler.cs
- RepeaterItem.cs
- TypedCompletedAsyncResult.cs
- path.cs
- AsyncContentLoadedEventArgs.cs
- CodeAccessPermission.cs
- BuildProviderAppliesToAttribute.cs
- ZoneMembershipCondition.cs
- CustomWebEventKey.cs
- ConnectionPoolManager.cs
- ScriptComponentDescriptor.cs
- ZipFileInfoCollection.cs
- ObjectDataSource.cs
- WebDisplayNameAttribute.cs
- Gdiplus.cs
- ComboBoxItem.cs
- CodeEntryPointMethod.cs
- Menu.cs
- XmlAnyElementAttributes.cs
- COMException.cs
- MembershipPasswordException.cs
- SoapSchemaExporter.cs
- SectionInformation.cs
- BoundField.cs
- FontFamily.cs
- CorrelationTokenTypeConvertor.cs
- DataBindingHandlerAttribute.cs
- EqualityComparer.cs
- SourceLocation.cs
- BmpBitmapDecoder.cs
- MsmqHostedTransportConfiguration.cs
- HMACSHA384.cs
- IntegerFacetDescriptionElement.cs
- SvcMapFile.cs
- PointValueSerializer.cs
- IIS7UserPrincipal.cs
- Processor.cs
- TextElementEnumerator.cs
- LocalIdCollection.cs
- FacetChecker.cs
- Single.cs
- QilVisitor.cs
- Scalars.cs
- Simplifier.cs
- StickyNoteContentControl.cs
- SimpleFieldTemplateFactory.cs
- StylusLogic.cs
- UnsafePeerToPeerMethods.cs
- TemplateNameScope.cs
- GridViewPageEventArgs.cs
- AssemblyEvidenceFactory.cs
- SessionState.cs
- xdrvalidator.cs
- DragEvent.cs
- LongPath.cs
- XmlWellformedWriterHelpers.cs
- CompositeCollectionView.cs
- OrderByBuilder.cs
- DbConnectionClosed.cs
- ConnectionInterfaceCollection.cs
- TextSpan.cs
- SafeHandle.cs
- XmlElementCollection.cs
- ListParagraph.cs
- DesignerHost.cs
- CssClassPropertyAttribute.cs
- UnsafeNativeMethods.cs