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
- CqlWriter.cs
- PreviewKeyDownEventArgs.cs
- EntityCodeGenerator.cs
- ThreadExceptionEvent.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ErrorWebPart.cs
- MessageBox.cs
- BufferBuilder.cs
- MailAddress.cs
- TextBox.cs
- URLMembershipCondition.cs
- Point3DAnimationUsingKeyFrames.cs
- TraceProvider.cs
- SpecialFolderEnumConverter.cs
- ReverseInheritProperty.cs
- _SingleItemRequestCache.cs
- BufferedGraphics.cs
- RIPEMD160Managed.cs
- OdbcFactory.cs
- PriorityBindingExpression.cs
- FixedSOMPageElement.cs
- WindowsBrush.cs
- DocumentSequence.cs
- TimeSpanStorage.cs
- ArrayMergeHelper.cs
- OleDbStruct.cs
- XmlWriterDelegator.cs
- ListParagraph.cs
- TextDpi.cs
- Literal.cs
- SessionEndingCancelEventArgs.cs
- FindCriteriaElement.cs
- DataRow.cs
- ManipulationDevice.cs
- Selector.cs
- FileCodeGroup.cs
- ToolStripComboBox.cs
- OleDbConnection.cs
- WebBrowserBase.cs
- ForwardPositionQuery.cs
- SAPICategories.cs
- CompositionTarget.cs
- PermissionSetEnumerator.cs
- DataViewListener.cs
- SamlSecurityToken.cs
- OAVariantLib.cs
- ObjectCache.cs
- BaseProcessProtocolHandler.cs
- IdentityReference.cs
- CalendarDateRangeChangingEventArgs.cs
- TableItemStyle.cs
- SecurityListenerSettingsLifetimeManager.cs
- DispatcherExceptionEventArgs.cs
- DefaultTraceListener.cs
- Point3DCollectionConverter.cs
- ListBoxAutomationPeer.cs
- XmlAutoDetectWriter.cs
- SearchExpression.cs
- ClientApiGenerator.cs
- DataPagerFieldItem.cs
- ArgumentOutOfRangeException.cs
- SchemaNotation.cs
- ParameterCollection.cs
- SchemaAttDef.cs
- PermissionSetEnumerator.cs
- StickyNoteHelper.cs
- CodeActivityMetadata.cs
- WhereaboutsReader.cs
- VBCodeProvider.cs
- Clause.cs
- SqlStatistics.cs
- ComplexPropertyEntry.cs
- ComboBoxDesigner.cs
- DBConnectionString.cs
- AuthStoreRoleProvider.cs
- GlobalEventManager.cs
- ApplySecurityAndSendAsyncResult.cs
- SmiEventSink_DeferedProcessing.cs
- QilScopedVisitor.cs
- OneOfScalarConst.cs
- DockPanel.cs
- GeneralTransform3DCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- ImageDrawing.cs
- XslTransform.cs
- DynamicRendererThreadManager.cs
- XPathMultyIterator.cs
- DirectoryInfo.cs
- CookieProtection.cs
- ErrorFormatterPage.cs
- Transform3DCollection.cs
- TreeViewEvent.cs
- DataStorage.cs
- ShapingEngine.cs
- FunctionImportElement.cs
- DataGridDetailsPresenterAutomationPeer.cs
- NodeLabelEditEvent.cs
- connectionpool.cs
- WebPartVerbsEventArgs.cs
- WindowsEditBox.cs