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
- CodeAccessPermission.cs
- FillErrorEventArgs.cs
- InternalDuplexChannelFactory.cs
- DirectoryObjectSecurity.cs
- DrawTreeNodeEventArgs.cs
- ConstructorExpr.cs
- CommentGlyph.cs
- DynamicValidator.cs
- BoundPropertyEntry.cs
- SQLInt32Storage.cs
- ElapsedEventArgs.cs
- KeySpline.cs
- PlatformNotSupportedException.cs
- TraceSection.cs
- log.cs
- PropertyChangedEventManager.cs
- FixedSOMTextRun.cs
- DataGridViewDataErrorEventArgs.cs
- BitFlagsGenerator.cs
- InvokeBinder.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- AppDomainGrammarProxy.cs
- Latin1Encoding.cs
- ConfigurationStrings.cs
- MdiWindowListStrip.cs
- Maps.cs
- XmlDomTextWriter.cs
- securestring.cs
- FontStyles.cs
- SmiEventSink_Default.cs
- AliasedSlot.cs
- DiscoveryEndpoint.cs
- Utilities.cs
- ErrorHandler.cs
- SmiRequestExecutor.cs
- LinqToSqlWrapper.cs
- DataBinding.cs
- JsonReader.cs
- AdvancedBindingPropertyDescriptor.cs
- NotifyIcon.cs
- Semaphore.cs
- ManagementOptions.cs
- AppDomain.cs
- InternalTypeHelper.cs
- CurrentTimeZone.cs
- ConfigurationLoaderException.cs
- DataObjectAttribute.cs
- CodeIterationStatement.cs
- InputScope.cs
- ResourceContainer.cs
- storepermissionattribute.cs
- BitConverter.cs
- RealizationDrawingContextWalker.cs
- LinkedResourceCollection.cs
- XmlILAnnotation.cs
- WindowsTokenRoleProvider.cs
- ComplexPropertyEntry.cs
- InfoCardBaseException.cs
- ScriptManagerProxy.cs
- AuthenticatedStream.cs
- sqlnorm.cs
- DelayedRegex.cs
- AuthorizationRuleCollection.cs
- BamlLocalizabilityResolver.cs
- SqlClientPermission.cs
- DataTableCollection.cs
- EventLogPermissionEntryCollection.cs
- OraclePermissionAttribute.cs
- DataRow.cs
- RecordBuilder.cs
- IPipelineRuntime.cs
- MarkupExtensionParser.cs
- TargetControlTypeCache.cs
- printdlgexmarshaler.cs
- ModuleElement.cs
- Array.cs
- ExternalException.cs
- InputLanguage.cs
- DocumentScope.cs
- CodeTypeReferenceExpression.cs
- ProgressBar.cs
- CacheRequest.cs
- ObjectHelper.cs
- NamedPipeConnectionPool.cs
- InputLanguageEventArgs.cs
- CqlLexer.cs
- XsltQilFactory.cs
- ComponentChangingEvent.cs
- LoginStatusDesigner.cs
- StringArrayEditor.cs
- TextContainer.cs
- SqlCacheDependency.cs
- SiteMapNodeItemEventArgs.cs
- TemplateXamlParser.cs
- InputBindingCollection.cs
- XslCompiledTransform.cs
- ScriptDescriptor.cs
- handlecollector.cs
- InternalConfigSettingsFactory.cs
- ObjectAnimationUsingKeyFrames.cs