Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 2 / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PackWebRequest.cs
- ScalarConstant.cs
- CursorInteropHelper.cs
- FileLevelControlBuilderAttribute.cs
- BidOverLoads.cs
- DataListCommandEventArgs.cs
- Int32CollectionConverter.cs
- Oci.cs
- QueryReaderSettings.cs
- GlyphsSerializer.cs
- StoreItemCollection.Loader.cs
- Rule.cs
- DataGridViewSelectedRowCollection.cs
- FixedPageStructure.cs
- ScalarConstant.cs
- CodeDomDesignerLoader.cs
- Relationship.cs
- CultureInfoConverter.cs
- GridViewUpdatedEventArgs.cs
- StylusPoint.cs
- NameValueCache.cs
- ProviderBase.cs
- TypedReference.cs
- ConfigurationValue.cs
- EntityWrapper.cs
- Inflater.cs
- ProxyWebPartManager.cs
- CodeObjectCreateExpression.cs
- ControlCollection.cs
- Soap12ServerProtocol.cs
- XmlDeclaration.cs
- ActivityContext.cs
- TraceHwndHost.cs
- XamlHostingConfiguration.cs
- DataBindingExpressionBuilder.cs
- DiagnosticTraceSchemas.cs
- DesignOnlyAttribute.cs
- ResourceAttributes.cs
- MissingMemberException.cs
- DragDeltaEventArgs.cs
- CodeMemberEvent.cs
- DateTimeOffsetAdapter.cs
- InputLanguageSource.cs
- TextChange.cs
- XMLDiffLoader.cs
- EmptyEnumerator.cs
- StrongNameIdentityPermission.cs
- DbConnectionInternal.cs
- BufferBuilder.cs
- NonBatchDirectoryCompiler.cs
- DispatcherProcessingDisabled.cs
- Filter.cs
- ScriptIgnoreAttribute.cs
- PageCache.cs
- XmlIgnoreAttribute.cs
- PagedDataSource.cs
- WindowsSolidBrush.cs
- PositiveTimeSpanValidator.cs
- CodeNamespaceCollection.cs
- BitmapFrame.cs
- Native.cs
- DataSetMappper.cs
- XmlSerializationReader.cs
- StringSource.cs
- LookupBindingPropertiesAttribute.cs
- BitHelper.cs
- ImportContext.cs
- Selection.cs
- ConstraintManager.cs
- NgenServicingAttributes.cs
- DurableDispatcherAddressingFault.cs
- CompiledQuery.cs
- TCPClient.cs
- DesignerLoader.cs
- SystemBrushes.cs
- TextRangeSerialization.cs
- XmlNodeComparer.cs
- ApplicationInterop.cs
- FontDialog.cs
- _Win32.cs
- ResolveResponseInfo.cs
- DataErrorValidationRule.cs
- CapabilitiesPattern.cs
- ListDependantCardsRequest.cs
- CheckBox.cs
- SqlDataSourceSelectingEventArgs.cs
- GridViewEditEventArgs.cs
- OrderedEnumerableRowCollection.cs
- SafeNativeMethods.cs
- BooleanStorage.cs
- CompilerCollection.cs
- SeekableReadStream.cs
- ColorConverter.cs
- ScalarConstant.cs
- AssemblyAssociatedContentFileAttribute.cs
- AbsoluteQuery.cs
- EventListenerClientSide.cs
- EditorReuseAttribute.cs
- AsmxEndpointPickerExtension.cs
- DataRecordInternal.cs