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
- ApplicationTrust.cs
- SqlXml.cs
- DeferredReference.cs
- RuntimeIdentifierPropertyAttribute.cs
- MetadataUtil.cs
- Visual3D.cs
- XmlSchemaInclude.cs
- XmlSchemaObject.cs
- SqlDataSourceStatusEventArgs.cs
- SettingsContext.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- VirtualDirectoryMapping.cs
- NamespaceMapping.cs
- UiaCoreProviderApi.cs
- NumberFormatter.cs
- ZeroOpNode.cs
- DrawingGroupDrawingContext.cs
- DescendantBaseQuery.cs
- LinqDataSourceDeleteEventArgs.cs
- UriTemplatePathSegment.cs
- AstTree.cs
- OleDbPermission.cs
- PointConverter.cs
- DaylightTime.cs
- ObjectToModelValueConverter.cs
- WorkflowMarkupSerializer.cs
- MailWebEventProvider.cs
- Int32Rect.cs
- IndependentAnimationStorage.cs
- XmlWriterTraceListener.cs
- Point3DConverter.cs
- PersonalizationStateQuery.cs
- SymbolMethod.cs
- SystemColors.cs
- WebPartAddingEventArgs.cs
- HwndHostAutomationPeer.cs
- HandleExceptionArgs.cs
- ComplexType.cs
- ReflectTypeDescriptionProvider.cs
- StoreItemCollection.Loader.cs
- ConditionalBranch.cs
- CounterSet.cs
- WithStatement.cs
- PageThemeParser.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- SizeChangedInfo.cs
- XmlnsDefinitionAttribute.cs
- HttpModuleCollection.cs
- TagPrefixInfo.cs
- VirtualizingStackPanel.cs
- EntityProviderServices.cs
- EntityAdapter.cs
- WebPartCloseVerb.cs
- XmlStreamStore.cs
- XmlTextEncoder.cs
- MobileErrorInfo.cs
- ProxyGenerator.cs
- DiscreteKeyFrames.cs
- RangeBase.cs
- SQLMembershipProvider.cs
- FixedTextContainer.cs
- Viewport2DVisual3D.cs
- ProtectedProviderSettings.cs
- WCFBuildProvider.cs
- basevalidator.cs
- HealthMonitoringSectionHelper.cs
- PeerCollaboration.cs
- SqlCacheDependencySection.cs
- SortedList.cs
- XmlEventCache.cs
- TextRangeAdaptor.cs
- Thickness.cs
- DataGridItem.cs
- DeviceSpecific.cs
- DataTableReader.cs
- WorkflowTransactionService.cs
- Accessible.cs
- StringAttributeCollection.cs
- ReferencedAssemblyResolver.cs
- Setter.cs
- GestureRecognitionResult.cs
- JsonStringDataContract.cs
- CompletionProxy.cs
- MimeTypePropertyAttribute.cs
- EventMap.cs
- FolderBrowserDialogDesigner.cs
- PageAsyncTask.cs
- PeerApplication.cs
- TableCell.cs
- PageRequestManager.cs
- PenContext.cs
- PathFigureCollectionConverter.cs
- CompiledXpathExpr.cs
- Wizard.cs
- MaskPropertyEditor.cs
- XmlAttributeOverrides.cs
- MenuEventArgs.cs
- ScriptControlDescriptor.cs
- ClientTargetSection.cs
- WindowsFormsLinkLabel.cs