Code:
/ FX-1434 / FX-1434 / 1.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
- SmiGettersStream.cs
- Span.cs
- DataControlButton.cs
- GridViewAutoFormat.cs
- InvalidWMPVersionException.cs
- ContextMarshalException.cs
- NamespaceDecl.cs
- WCFServiceClientProxyGenerator.cs
- X509IssuerSerialKeyIdentifierClause.cs
- SQLConvert.cs
- ContextMenuStripGroup.cs
- HostSecurityManager.cs
- ListSourceHelper.cs
- DynamicPropertyReader.cs
- TrustManagerMoreInformation.cs
- BuilderPropertyEntry.cs
- ImageAttributes.cs
- ImageBrush.cs
- GorillaCodec.cs
- VectorCollectionValueSerializer.cs
- AssemblyFilter.cs
- WebPartCloseVerb.cs
- AndCondition.cs
- FormsAuthenticationCredentials.cs
- TriggerCollection.cs
- CellIdBoolean.cs
- CollectionBuilder.cs
- HtmlHead.cs
- SqlAliasesReferenced.cs
- SingleStorage.cs
- QueryStringParameter.cs
- BuildProvidersCompiler.cs
- BaseTemplatedMobileComponentEditor.cs
- AssemblyCollection.cs
- Timer.cs
- StringReader.cs
- TextSegment.cs
- DetailsViewRow.cs
- Rules.cs
- EncoderFallback.cs
- CompareValidator.cs
- Thread.cs
- UInt64.cs
- ToolStripGripRenderEventArgs.cs
- _ConnectStream.cs
- Helpers.cs
- TransactionProxy.cs
- AsyncCompletedEventArgs.cs
- ObjectStateEntryDbDataRecord.cs
- HttpRuntime.cs
- GiveFeedbackEventArgs.cs
- MembershipPasswordException.cs
- IPGlobalProperties.cs
- UserControlBuildProvider.cs
- CopyCodeAction.cs
- Mappings.cs
- XmlQueryOutput.cs
- TokenCreationParameter.cs
- DesignerView.Commands.cs
- CharAnimationBase.cs
- XmlAtomicValue.cs
- ClickablePoint.cs
- ImportDesigner.xaml.cs
- BackStopAuthenticationModule.cs
- DataPointer.cs
- x509store.cs
- FormatSettings.cs
- Style.cs
- EncoderParameter.cs
- X509CertificateValidator.cs
- Triplet.cs
- PropertyDescriptor.cs
- RecommendedAsConfigurableAttribute.cs
- DataServiceHostWrapper.cs
- WebPartTransformerAttribute.cs
- FolderBrowserDialogDesigner.cs
- DataServiceRequestException.cs
- OdbcConnectionHandle.cs
- DivideByZeroException.cs
- DataGridViewHitTestInfo.cs
- ErrorsHelper.cs
- DependentList.cs
- Delegate.cs
- Context.cs
- __ConsoleStream.cs
- LocalFileSettingsProvider.cs
- TcpProcessProtocolHandler.cs
- MailBnfHelper.cs
- CompositionTarget.cs
- SystemGatewayIPAddressInformation.cs
- EventMappingSettingsCollection.cs
- PtsHost.cs
- OleDbParameter.cs
- CodeDirectoryCompiler.cs
- OLEDB_Enum.cs
- XhtmlBasicCalendarAdapter.cs
- OwnerDrawPropertyBag.cs
- SpecialFolderEnumConverter.cs
- QueryConverter.cs
- DataBindingCollection.cs