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
- X509CertificateValidationMode.cs
- AssemblySettingAttributes.cs
- ColorDialog.cs
- StringUtil.cs
- ConnectionPoolManager.cs
- SemaphoreSecurity.cs
- PropVariant.cs
- ToolStripGripRenderEventArgs.cs
- TemplateControl.cs
- XPathCompileException.cs
- XmlReader.cs
- PackageDigitalSignatureManager.cs
- RubberbandSelector.cs
- DataServiceProviderWrapper.cs
- DataControlLinkButton.cs
- SimpleApplicationHost.cs
- _AuthenticationState.cs
- Bits.cs
- DemultiplexingClientMessageFormatter.cs
- ViewSimplifier.cs
- RoutedEventArgs.cs
- SocketInformation.cs
- PenThreadWorker.cs
- DbConnectionPoolGroup.cs
- ProfileGroupSettings.cs
- GridViewActionList.cs
- HttpListener.cs
- XMLSyntaxException.cs
- Transform.cs
- DockAndAnchorLayout.cs
- ClonableStack.cs
- AnimationLayer.cs
- CommandBinding.cs
- AlignmentXValidation.cs
- ConstraintConverter.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- PatternMatcher.cs
- TextServicesDisplayAttribute.cs
- ResXFileRef.cs
- TextTabProperties.cs
- ClientConfigurationHost.cs
- ClientUtils.cs
- CacheHelper.cs
- DataGridCellAutomationPeer.cs
- DataSourceHelper.cs
- RuleSettingsCollection.cs
- ImageDrawing.cs
- XmlWriterTraceListener.cs
- AssemblyInfo.cs
- DiagnosticTraceSource.cs
- EditorPartCollection.cs
- TextModifierScope.cs
- EmptyCollection.cs
- EmptyEnumerator.cs
- DbDataSourceEnumerator.cs
- XmlSchemaCollection.cs
- SqlNotificationRequest.cs
- FormatSettings.cs
- AdjustableArrowCap.cs
- RemoteCryptoTokenProvider.cs
- XPathNodePointer.cs
- ImageListStreamer.cs
- SerializableTypeCodeDomSerializer.cs
- HtmlGenericControl.cs
- IdentityHolder.cs
- ImageBrush.cs
- TargetPerspective.cs
- SiteMapPath.cs
- OutputCacheSection.cs
- DbParameterCollection.cs
- OperationInvokerTrace.cs
- InternalResources.cs
- ObjectDataSourceSelectingEventArgs.cs
- LinkConverter.cs
- NominalTypeEliminator.cs
- IntSecurity.cs
- XmlSchemaAttributeGroup.cs
- CommandManager.cs
- DBSqlParser.cs
- SmtpMail.cs
- QilReplaceVisitor.cs
- WebConvert.cs
- CompilerScope.cs
- HwndSource.cs
- ToolBarButton.cs
- Int64AnimationUsingKeyFrames.cs
- KeyFrames.cs
- AnimatedTypeHelpers.cs
- BufferCache.cs
- XLinq.cs
- BigInt.cs
- TcpClientChannel.cs
- SystemIPGlobalStatistics.cs
- MeasurementDCInfo.cs
- TypedReference.cs
- Query.cs
- SaveFileDialog.cs
- RTLAwareMessageBox.cs
- SqlDataSourceFilteringEventArgs.cs
- CompoundFileStreamReference.cs