Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DetailsViewUpdatedEventArgs.cs
- CapabilitiesSection.cs
- COM2FontConverter.cs
- AssemblyAttributesGoHere.cs
- DataBoundControlHelper.cs
- XsltArgumentList.cs
- DataControlHelper.cs
- ButtonStandardAdapter.cs
- PinnedBufferMemoryStream.cs
- ErrorProvider.cs
- HelpKeywordAttribute.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- XmlSchemaFacet.cs
- OpenFileDialog.cs
- WmlImageAdapter.cs
- PersonalizationProvider.cs
- ListBox.cs
- OleDbConnectionFactory.cs
- EntityDataSourceUtil.cs
- BitVector32.cs
- DesignerLoader.cs
- RawUIStateInputReport.cs
- ViewStateException.cs
- ConfigurationStrings.cs
- GroupBoxRenderer.cs
- XPathCompileException.cs
- ColumnCollection.cs
- CommonProperties.cs
- ParserStreamGeometryContext.cs
- AssociationType.cs
- CompositeControl.cs
- DbConnectionPoolIdentity.cs
- LocalClientSecuritySettings.cs
- ListBoxItemWrapperAutomationPeer.cs
- GroupQuery.cs
- HostingEnvironment.cs
- RowToParametersTransformer.cs
- backend.cs
- ResolveDuplex11AsyncResult.cs
- DeflateStream.cs
- SqlProvider.cs
- WebGetAttribute.cs
- SafeWaitHandle.cs
- TransactionManager.cs
- DateTimeFormatInfoScanner.cs
- SqlDataSourceSelectingEventArgs.cs
- MarkerProperties.cs
- ImageBrush.cs
- CorrelationInitializer.cs
- DocumentViewerAutomationPeer.cs
- CodeObject.cs
- ProcessingInstructionAction.cs
- XmlWellformedWriter.cs
- BinaryObjectInfo.cs
- RectangleHotSpot.cs
- HelloOperation11AsyncResult.cs
- DBDataPermissionAttribute.cs
- ToolboxDataAttribute.cs
- AnnotationAdorner.cs
- FillBehavior.cs
- MaskedTextProvider.cs
- datacache.cs
- TableLayoutStyle.cs
- log.cs
- _OSSOCK.cs
- HtmlTableRow.cs
- UrlUtility.cs
- StackBuilderSink.cs
- InnerItemCollectionView.cs
- DNS.cs
- EncryptedReference.cs
- FontFamilyConverter.cs
- DriveNotFoundException.cs
- HasCopySemanticsAttribute.cs
- TableLayoutStyle.cs
- CodeTypeDeclarationCollection.cs
- ImpersonateTokenRef.cs
- ShapingWorkspace.cs
- ViewDesigner.cs
- ToolStripItem.cs
- XmlImplementation.cs
- PriorityQueue.cs
- SamlConstants.cs
- ChangeBlockUndoRecord.cs
- TerminateDesigner.cs
- NavigationPropertyEmitter.cs
- ClientBuildManager.cs
- DataGridItemEventArgs.cs
- PipeSecurity.cs
- BindingExpressionBase.cs
- CreationContext.cs
- TimeManager.cs
- OleDbPropertySetGuid.cs
- ProfilePropertySettingsCollection.cs
- CompilerParameters.cs
- KoreanLunisolarCalendar.cs
- DoubleLinkListEnumerator.cs
- CollectionEditVerbManager.cs
- SchemaInfo.cs
- EUCJPEncoding.cs