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
- XmlValueConverter.cs
- SendMailErrorEventArgs.cs
- ContentPlaceHolder.cs
- CommandDevice.cs
- DeviceContexts.cs
- FileSystemInfo.cs
- ListBox.cs
- UrlPath.cs
- UpdatePanelControlTrigger.cs
- Int16Storage.cs
- DictionaryCustomTypeDescriptor.cs
- UInt64.cs
- CaseInsensitiveComparer.cs
- TransactionCache.cs
- ViewStateException.cs
- DataControlFieldCell.cs
- CriticalHandle.cs
- ConnectionProviderAttribute.cs
- CustomErrorCollection.cs
- precedingsibling.cs
- XPathNavigatorReader.cs
- TextElement.cs
- CommunicationObjectAbortedException.cs
- UInt32Converter.cs
- BufferAllocator.cs
- BindingElementExtensionElement.cs
- MemoryMappedViewAccessor.cs
- KeyNotFoundException.cs
- Polyline.cs
- OperationFormatter.cs
- Roles.cs
- PrivilegeNotHeldException.cs
- SegmentInfo.cs
- HyperLink.cs
- SelectionRange.cs
- TypeLoadException.cs
- VirtualPath.cs
- RootProfilePropertySettingsCollection.cs
- UnaryNode.cs
- PropertyNames.cs
- ReadOnlyTernaryTree.cs
- LocalizabilityAttribute.cs
- HandlerBase.cs
- WindowsGraphics2.cs
- Debug.cs
- X509SecurityToken.cs
- TraceContextEventArgs.cs
- OleStrCAMarshaler.cs
- DetailsViewUpdatedEventArgs.cs
- BlockCollection.cs
- TypeValidationEventArgs.cs
- ThreadAbortException.cs
- GroupBox.cs
- ActivityStateQuery.cs
- ServiceBusyException.cs
- XmlSerializableReader.cs
- QueryableFilterUserControl.cs
- PartialCachingAttribute.cs
- MarginCollapsingState.cs
- SqlUtil.cs
- XmlRawWriter.cs
- DictionaryEntry.cs
- XmlCollation.cs
- WebServiceHandler.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- SimpleMailWebEventProvider.cs
- CatalogZone.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ColumnWidthChangingEvent.cs
- MethodBody.cs
- DataGridPagerStyle.cs
- BaseConfigurationRecord.cs
- SamlAction.cs
- WebPartConnectionsConfigureVerb.cs
- StsCommunicationException.cs
- RuntimeConfig.cs
- UnmanagedHandle.cs
- CreateParams.cs
- ApplicationInfo.cs
- SqlBuilder.cs
- BufferedGraphicsManager.cs
- SourceChangedEventArgs.cs
- URLAttribute.cs
- ListViewHitTestInfo.cs
- WeakHashtable.cs
- Helpers.cs
- SmiSettersStream.cs
- DataGridViewCheckBoxColumn.cs
- FileChangesMonitor.cs
- GreenMethods.cs
- PositiveTimeSpanValidatorAttribute.cs
- FixedSOMTable.cs
- CryptographicAttribute.cs
- RoutedPropertyChangedEventArgs.cs
- Menu.cs
- smtpconnection.cs
- FileVersionInfo.cs
- ModuleBuilderData.cs
- MULTI_QI.cs
- dsa.cs