Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 1305376 / 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
- WebServiceErrorEvent.cs
- ConfigurationProviderException.cs
- PartitionResolver.cs
- PackageStore.cs
- DbProviderFactory.cs
- SqlTriggerAttribute.cs
- PerformanceCounterPermissionEntry.cs
- ProcessMonitor.cs
- BinHexDecoder.cs
- DataGridToolTip.cs
- UIAgentMonitorHandle.cs
- Reference.cs
- CustomErrorsSection.cs
- SspiWrapper.cs
- SafeNativeMethods.cs
- SplashScreen.cs
- OptimalTextSource.cs
- StatusStrip.cs
- Vector3DAnimation.cs
- ComponentChangingEvent.cs
- ReaderWriterLockWrapper.cs
- StrongName.cs
- CodeGeneratorOptions.cs
- precedingsibling.cs
- GenericTypeParameterBuilder.cs
- KeyValuePairs.cs
- DataControlPagerLinkButton.cs
- XmlCharType.cs
- PageParserFilter.cs
- AttributeQuery.cs
- RenderDataDrawingContext.cs
- FillRuleValidation.cs
- StringValidator.cs
- DoubleLinkList.cs
- ObjectNavigationPropertyMapping.cs
- Visitors.cs
- ViewStateException.cs
- IPAddress.cs
- DbConnectionFactory.cs
- ItemDragEvent.cs
- BindableAttribute.cs
- TitleStyle.cs
- GenericFlowSwitchHelper.cs
- FactorySettingsElement.cs
- DoubleAnimationClockResource.cs
- Model3DGroup.cs
- DbModificationCommandTree.cs
- SrgsText.cs
- Win32KeyboardDevice.cs
- SessionParameter.cs
- SineEase.cs
- NativeMethods.cs
- Canvas.cs
- ApplicationFileParser.cs
- ConditionBrowserDialog.cs
- WindowPatternIdentifiers.cs
- DataSourceGeneratorException.cs
- SafeHandles.cs
- RoleGroupCollectionEditor.cs
- OperatingSystem.cs
- BufferBuilder.cs
- HtmlWindow.cs
- PipeException.cs
- CodeGenHelper.cs
- StreamReader.cs
- BindingContext.cs
- Html32TextWriter.cs
- Form.cs
- NativeStructs.cs
- Parser.cs
- ColorAnimationUsingKeyFrames.cs
- RewritingProcessor.cs
- ReleaseInstanceMode.cs
- CodeTypeParameter.cs
- Vertex.cs
- MarkedHighlightComponent.cs
- DataTemplateKey.cs
- LogPolicy.cs
- Win32Native.cs
- SimpleTextLine.cs
- WindowsToolbar.cs
- UnSafeCharBuffer.cs
- TypedRowGenerator.cs
- CreateUserWizardStep.cs
- LinqToSqlWrapper.cs
- MailMessageEventArgs.cs
- CallbackBehaviorAttribute.cs
- DataDocumentXPathNavigator.cs
- HostingPreferredMapPath.cs
- ResourceDescriptionAttribute.cs
- DataServiceProcessingPipeline.cs
- AttachedProperty.cs
- LedgerEntry.cs
- AssemblyNameProxy.cs
- DeclaredTypeElement.cs
- util.cs
- DoubleLinkList.cs
- SelectedGridItemChangedEvent.cs
- DependencyObjectType.cs
- HttpWebRequest.cs