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
- TreeNode.cs
- SqlXml.cs
- ConditionalDesigner.cs
- XmlQueryRuntime.cs
- SourceElementsCollection.cs
- SpellerInterop.cs
- SpeechRecognizer.cs
- EventPrivateKey.cs
- InOutArgument.cs
- InvokeGenerator.cs
- XmlSchemaAttribute.cs
- MessageHeaders.cs
- AnnotationComponentManager.cs
- ApplicationHost.cs
- MasterPageBuildProvider.cs
- BinaryNode.cs
- ServiceModelSecurityTokenRequirement.cs
- SqlNodeTypeOperators.cs
- FilteredAttributeCollection.cs
- SimpleFileLog.cs
- TypeDescriptor.cs
- DataGridViewCellConverter.cs
- NamespaceEmitter.cs
- StringInfo.cs
- ImageUrlEditor.cs
- _BasicClient.cs
- ObjectViewListener.cs
- TargetFrameworkAttribute.cs
- VScrollProperties.cs
- PointUtil.cs
- SmiEventStream.cs
- CompilationUnit.cs
- Vector3DAnimationBase.cs
- ObjectContextServiceProvider.cs
- XmlWriterSettings.cs
- ClientSettingsSection.cs
- PropertyDescriptorCollection.cs
- Visitors.cs
- WorkflowValidationFailedException.cs
- UnsafeNativeMethods.cs
- StyleHelper.cs
- NameValuePair.cs
- ActiveXHost.cs
- Input.cs
- MimeParameter.cs
- QueryRewriter.cs
- OdbcConnection.cs
- JsonCollectionDataContract.cs
- KeyConverter.cs
- KeyValuePairs.cs
- PipeException.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ArrayList.cs
- UnmanagedBitmapWrapper.cs
- PrinterUnitConvert.cs
- WindowCollection.cs
- TypeUsageBuilder.cs
- TreeNodeBinding.cs
- LoadWorkflowByKeyAsyncResult.cs
- FamilyTypefaceCollection.cs
- CopyNamespacesAction.cs
- RoleServiceManager.cs
- ErrorItem.cs
- CharacterShapingProperties.cs
- HttpListenerResponse.cs
- HandleExceptionArgs.cs
- EventProxy.cs
- BitHelper.cs
- NavigationPropertyEmitter.cs
- Cast.cs
- CodeTypeParameterCollection.cs
- ClientUrlResolverWrapper.cs
- UriExt.cs
- MessageLogTraceRecord.cs
- StructuredTypeEmitter.cs
- BamlStream.cs
- SchemaAttDef.cs
- Camera.cs
- NegationPusher.cs
- ImageBrush.cs
- ResourceWriter.cs
- ObjectStateEntryDbDataRecord.cs
- IListConverters.cs
- RowToParametersTransformer.cs
- CLRBindingWorker.cs
- FacetValues.cs
- _AuthenticationState.cs
- DiscoveryDocumentSerializer.cs
- ProfileParameter.cs
- Int16KeyFrameCollection.cs
- TabPanel.cs
- RegexEditorDialog.cs
- ValueCollectionParameterReader.cs
- Nullable.cs
- BitVector32.cs
- HttpCachePolicyElement.cs
- TransformPattern.cs
- DtrList.cs
- ReachDocumentPageSerializer.cs
- SharedHttpsTransportManager.cs