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
- AssociationTypeEmitter.cs
- TaskDesigner.cs
- ShapeTypeface.cs
- DoubleConverter.cs
- SqlServices.cs
- PeerCollaboration.cs
- WrapPanel.cs
- DynamicDataRouteHandler.cs
- BevelBitmapEffect.cs
- InfoCardPolicy.cs
- DateTimeOffset.cs
- TextCompositionEventArgs.cs
- GroupDescription.cs
- UntrustedRecipientException.cs
- DiagnosticStrings.cs
- NumberFunctions.cs
- ConstructorNeedsTagAttribute.cs
- Viewport3DAutomationPeer.cs
- UnsafeMethods.cs
- LockRecursionException.cs
- ZipIOLocalFileDataDescriptor.cs
- OutputScope.cs
- FormsAuthentication.cs
- XmlProcessingInstruction.cs
- DisplayMemberTemplateSelector.cs
- ImageUrlEditor.cs
- NativeCppClassAttribute.cs
- TemplateBindingExpressionConverter.cs
- BooleanAnimationBase.cs
- PropertyIDSet.cs
- Vector3DCollectionConverter.cs
- XamlSerializer.cs
- SQLDateTimeStorage.cs
- IisTraceListener.cs
- ColorMap.cs
- _Win32.cs
- XmlAttributeOverrides.cs
- DBAsyncResult.cs
- StructuredTypeInfo.cs
- CounterSampleCalculator.cs
- SchemaImporterExtension.cs
- MasterPageCodeDomTreeGenerator.cs
- MsmqAppDomainProtocolHandler.cs
- XmlReflectionImporter.cs
- RepeatBehavior.cs
- NonSerializedAttribute.cs
- ObjectConverter.cs
- MultiSelectRootGridEntry.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- TypeUnloadedException.cs
- DbConnectionStringBuilder.cs
- WindowsStatusBar.cs
- DataGridBoolColumn.cs
- CounterSampleCalculator.cs
- TemplateParser.cs
- TraceContext.cs
- ConnectionPoint.cs
- ColumnHeaderConverter.cs
- ExceptionHandlerDesigner.cs
- ErrorWebPart.cs
- BaseTemplateBuildProvider.cs
- Column.cs
- XmlSortKey.cs
- KeyNotFoundException.cs
- UrlPath.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DataGridViewCellValueEventArgs.cs
- ByteStreamGeometryContext.cs
- SecurityDescriptor.cs
- InvokePattern.cs
- DynamicResourceExtension.cs
- ValidationErrorInfo.cs
- BitmapFrame.cs
- TextEditor.cs
- SocketInformation.cs
- RandomNumberGenerator.cs
- Point4DConverter.cs
- MissingSatelliteAssemblyException.cs
- ImmutableObjectAttribute.cs
- CheckBoxRenderer.cs
- ByteStreamGeometryContext.cs
- TraceEventCache.cs
- AttributeQuery.cs
- SerializableAttribute.cs
- TriggerBase.cs
- PackagePartCollection.cs
- ToolStripManager.cs
- MobileCategoryAttribute.cs
- RawAppCommandInputReport.cs
- PageWrapper.cs
- TextProperties.cs
- AdministrationHelpers.cs
- LinkLabelLinkClickedEvent.cs
- HMAC.cs
- QilNode.cs
- Misc.cs
- _NestedSingleAsyncResult.cs
- PropertyGridEditorPart.cs
- EdmToObjectNamespaceMap.cs
- ThousandthOfEmRealDoubles.cs