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
- DataBoundControlAdapter.cs
- StylusTip.cs
- TakeQueryOptionExpression.cs
- CqlErrorHelper.cs
- XmlSerializerSection.cs
- DataGridViewCellStyleConverter.cs
- QueryResponse.cs
- DefaultPropertyAttribute.cs
- _HTTPDateParse.cs
- GeneralTransform3DCollection.cs
- Process.cs
- XmlnsDefinitionAttribute.cs
- ProtocolsSection.cs
- LogReservationCollection.cs
- Viewport3DVisual.cs
- DefaultObjectMappingItemCollection.cs
- LineInfo.cs
- TransformerInfo.cs
- ViewBox.cs
- AsynchronousChannelMergeEnumerator.cs
- IndexedSelectQueryOperator.cs
- ClientScriptManager.cs
- SystemIPInterfaceProperties.cs
- WeakEventTable.cs
- WebPartConnectVerb.cs
- BuilderPropertyEntry.cs
- ButtonFieldBase.cs
- WebPartTransformer.cs
- BulletedList.cs
- TransportSecurityBindingElement.cs
- HttpDictionary.cs
- GridViewUpdateEventArgs.cs
- Pen.cs
- DiscreteKeyFrames.cs
- ObjectDataSourceChooseTypePanel.cs
- ToolStripContainerDesigner.cs
- CollectionViewGroupRoot.cs
- PropertyGridEditorPart.cs
- DrawingServices.cs
- Point4D.cs
- XamlPathDataSerializer.cs
- TransactionException.cs
- Translator.cs
- DesignerListAdapter.cs
- MetafileHeader.cs
- Util.cs
- DeploymentExceptionMapper.cs
- ElapsedEventArgs.cs
- ClientSettingsStore.cs
- FacetDescription.cs
- LocalBuilder.cs
- ToolZone.cs
- QilValidationVisitor.cs
- XmlNodeList.cs
- CodeTypeConstructor.cs
- SimpleTableProvider.cs
- HostedHttpContext.cs
- InternalsVisibleToAttribute.cs
- AssociationSet.cs
- UInt32Converter.cs
- FormsAuthenticationEventArgs.cs
- HandleExceptionArgs.cs
- PerformanceCounterPermission.cs
- relpropertyhelper.cs
- ToolBarTray.cs
- GroupBox.cs
- DataGridViewTextBoxColumn.cs
- CngProperty.cs
- SchemaElementDecl.cs
- RuntimeEnvironment.cs
- ISO2022Encoding.cs
- SqlBuilder.cs
- EmptyStringExpandableObjectConverter.cs
- ChildDocumentBlock.cs
- EventDescriptorCollection.cs
- OracleRowUpdatingEventArgs.cs
- IfAction.cs
- XPathSelectionIterator.cs
- Int32Converter.cs
- ColorMatrix.cs
- InputLanguageSource.cs
- ScrollEvent.cs
- Transform.cs
- Propagator.ExtentPlaceholderCreator.cs
- BufferModesCollection.cs
- PerformanceCounter.cs
- HashSetEqualityComparer.cs
- PtsCache.cs
- BinaryObjectWriter.cs
- ObjectItemCachedAssemblyLoader.cs
- Baml2006KnownTypes.cs
- AnnotationStore.cs
- EventToken.cs
- ThrowHelper.cs
- FixedDocumentPaginator.cs
- CustomAssemblyResolver.cs
- ClientBuildManager.cs
- HtmlGenericControl.cs
- PreProcessor.cs
- EventSourceCreationData.cs