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
- ContainerSelectorActiveEvent.cs
- LingerOption.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- AppDomainManager.cs
- WebPartCatalogAddVerb.cs
- DataGridTemplateColumn.cs
- FlowPanelDesigner.cs
- ReferenceTypeElement.cs
- PerformanceCountersElement.cs
- InternalBufferManager.cs
- ThicknessAnimationUsingKeyFrames.cs
- ResXResourceSet.cs
- Tag.cs
- _NetRes.cs
- DataRow.cs
- CodeCatchClauseCollection.cs
- ModelFactory.cs
- TabControl.cs
- NullReferenceException.cs
- EventPropertyMap.cs
- OdbcEnvironmentHandle.cs
- SerializationInfoEnumerator.cs
- HtmlLink.cs
- Matrix3D.cs
- CheckBox.cs
- InlineUIContainer.cs
- ManagedFilter.cs
- RootContext.cs
- UnmanagedMarshal.cs
- DescendantOverDescendantQuery.cs
- PersonalizationProviderCollection.cs
- PromptBuilder.cs
- SettingsPropertyIsReadOnlyException.cs
- ContainerFilterService.cs
- ConsumerConnectionPointCollection.cs
- EntityContainer.cs
- DataGridViewRowHeaderCell.cs
- SizeF.cs
- Bitmap.cs
- WebPartActionVerb.cs
- DefaultBinder.cs
- EntityDataSourceContainerNameConverter.cs
- ConcatQueryOperator.cs
- EntityObject.cs
- KnownTypeDataContractResolver.cs
- bidPrivateBase.cs
- GeneralTransformCollection.cs
- DPCustomTypeDescriptor.cs
- CreateUserWizard.cs
- ImageSource.cs
- TemplateBindingExpressionConverter.cs
- UnsafeNativeMethods.cs
- OutputCacheModule.cs
- WindowsListBox.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- ItemCollection.cs
- EdmToObjectNamespaceMap.cs
- SafeNativeMethodsOther.cs
- PointUtil.cs
- WpfMemberInvoker.cs
- Deserializer.cs
- JsonServiceDocumentSerializer.cs
- CaseKeyBox.xaml.cs
- UpWmlMobileTextWriter.cs
- mactripleDES.cs
- CompModHelpers.cs
- StatusBar.cs
- OptionalColumn.cs
- EdmScalarPropertyAttribute.cs
- BindingCollection.cs
- ExtensionDataReader.cs
- HtmlTableRowCollection.cs
- PageStatePersister.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- GeometryHitTestResult.cs
- _LocalDataStoreMgr.cs
- ControlEvent.cs
- StringOutput.cs
- XmlAggregates.cs
- DesignerObject.cs
- FullTextLine.cs
- ResourceDefaultValueAttribute.cs
- dataprotectionpermissionattribute.cs
- ArraySubsetEnumerator.cs
- SiteMapNodeItemEventArgs.cs
- WizardStepBase.cs
- EntityDataSourceChangedEventArgs.cs
- AuthStoreRoleProvider.cs
- ListParagraph.cs
- DirectionalLight.cs
- ParseChildrenAsPropertiesAttribute.cs
- M3DUtil.cs
- SHA512.cs
- BamlWriter.cs
- CapabilitiesRule.cs
- DataGridViewComboBoxEditingControl.cs
- CollaborationHelperFunctions.cs
- ToolStripSeparator.cs
- BaseDataBoundControl.cs
- IndexedString.cs