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
- TimeSpanValidatorAttribute.cs
- smtppermission.cs
- SmiEventSink_DeferedProcessing.cs
- ObjectItemNoOpAssemblyLoader.cs
- InputLangChangeRequestEvent.cs
- ControlPropertyNameConverter.cs
- ComponentEditorPage.cs
- HelpEvent.cs
- DateTimeOffset.cs
- MultiBindingExpression.cs
- WSSecurityJan2004.cs
- ListViewItemCollectionEditor.cs
- cookiecollection.cs
- XmlChoiceIdentifierAttribute.cs
- OleDbRowUpdatingEvent.cs
- RoleManagerEventArgs.cs
- SqlCommandBuilder.cs
- OleDbConnection.cs
- AvTraceDetails.cs
- LocalIdKeyIdentifierClause.cs
- SchemaImporter.cs
- ButtonColumn.cs
- TripleDES.cs
- XNodeNavigator.cs
- RectValueSerializer.cs
- NetworkInformationException.cs
- DataGridColumnStyleMappingNameEditor.cs
- LocationSectionRecord.cs
- ExceptionUtility.cs
- GridViewRowEventArgs.cs
- GeometryValueSerializer.cs
- DisplayInformation.cs
- OpenTypeCommon.cs
- DataSourceCache.cs
- SortQuery.cs
- NoneExcludedImageIndexConverter.cs
- TemplateBindingExpressionConverter.cs
- LookupBindingPropertiesAttribute.cs
- TagPrefixAttribute.cs
- BitConverter.cs
- FixedDSBuilder.cs
- BinaryFormatter.cs
- SrgsElement.cs
- SqlCharStream.cs
- MsmqIntegrationBindingElement.cs
- SiteMapNode.cs
- FontNamesConverter.cs
- SafeHandle.cs
- WebPartConnectionsConfigureVerb.cs
- WmlObjectListAdapter.cs
- RoamingStoreFileUtility.cs
- StreamGeometryContext.cs
- InvokeMemberBinder.cs
- TableRowGroup.cs
- FullTrustAssemblyCollection.cs
- ViewStateModeByIdAttribute.cs
- MaterialGroup.cs
- ExeContext.cs
- SafeFileMappingHandle.cs
- SiteMapNodeCollection.cs
- ImageResources.Designer.cs
- UnsafeNativeMethods.cs
- DoubleSumAggregationOperator.cs
- AutomationProperties.cs
- ChannelEndpointElementCollection.cs
- HtmlElementCollection.cs
- basenumberconverter.cs
- DrawListViewItemEventArgs.cs
- WebPartDisplayModeCollection.cs
- IDQuery.cs
- TimeZone.cs
- MeasureItemEvent.cs
- TransportContext.cs
- StatusBarPanelClickEvent.cs
- ValidationErrorCollection.cs
- CodeAttributeArgumentCollection.cs
- NativeActivityMetadata.cs
- TableLayoutColumnStyleCollection.cs
- CompatibleIComparer.cs
- QuaternionAnimation.cs
- XPathBinder.cs
- Win32.cs
- DataGridViewCellValidatingEventArgs.cs
- Calendar.cs
- IISUnsafeMethods.cs
- TextElement.cs
- LinqDataSourceSelectEventArgs.cs
- GridErrorDlg.cs
- StringWriter.cs
- TimeSpan.cs
- XmlMapping.cs
- BindStream.cs
- ApplicationManager.cs
- BookmarkUndoUnit.cs
- LazyTextWriterCreator.cs
- AccessDataSourceView.cs
- TextServicesDisplayAttribute.cs
- WindowsFormsSectionHandler.cs
- CodeIndexerExpression.cs
- PerformanceCounter.cs