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
- ProtocolsSection.cs
- HasCopySemanticsAttribute.cs
- MediaTimeline.cs
- IndentTextWriter.cs
- XomlCompiler.cs
- ByteConverter.cs
- TraceLog.cs
- ProbeMatchesMessageCD1.cs
- Transform3D.cs
- ConfigurationConverterBase.cs
- SSmlParser.cs
- HashCryptoHandle.cs
- DetailsViewInsertEventArgs.cs
- NegotiateStream.cs
- recordstatescratchpad.cs
- CssTextWriter.cs
- PrimitiveDataContract.cs
- HttpDictionary.cs
- TextContainer.cs
- ParserExtension.cs
- TemplateContent.cs
- UICuesEvent.cs
- ToolStripButton.cs
- StringValueSerializer.cs
- FileUpload.cs
- Schema.cs
- XPathConvert.cs
- WebPartTransformerAttribute.cs
- RawStylusSystemGestureInputReport.cs
- DeclarativeCatalogPartDesigner.cs
- GridProviderWrapper.cs
- XmlAttributeAttribute.cs
- ColumnResizeAdorner.cs
- validationstate.cs
- TcpClientChannel.cs
- TypeContext.cs
- SiteMapNodeCollection.cs
- CounterCreationDataCollection.cs
- DbException.cs
- RequestNavigateEventArgs.cs
- Selection.cs
- DiffuseMaterial.cs
- StyleTypedPropertyAttribute.cs
- EditorAttribute.cs
- SystemIPv6InterfaceProperties.cs
- ThemeDirectoryCompiler.cs
- SymbolPair.cs
- PathGradientBrush.cs
- FocusManager.cs
- XmlSerializerFactory.cs
- ByteStreamBufferedMessageData.cs
- AutomationElement.cs
- SqlInternalConnectionTds.cs
- MultipartContentParser.cs
- HandleExceptionArgs.cs
- LinqDataView.cs
- UnlockInstanceCommand.cs
- StackSpiller.Temps.cs
- safePerfProviderHandle.cs
- TextParaLineResult.cs
- SettingsBase.cs
- CookieProtection.cs
- WindowsToolbarItemAsMenuItem.cs
- SHA512.cs
- DomNameTable.cs
- BinaryFormatter.cs
- CngKeyBlobFormat.cs
- Menu.cs
- ApplicationFileParser.cs
- LinearKeyFrames.cs
- InternalEnumValidator.cs
- ViewStateException.cs
- Sequence.cs
- RuntimeCompatibilityAttribute.cs
- Splitter.cs
- MultiView.cs
- SqlDataReader.cs
- XmlSerializerFaultFormatter.cs
- StreamWriter.cs
- InternalDispatchObject.cs
- DataListItemEventArgs.cs
- SubtreeProcessor.cs
- QualifiedCellIdBoolean.cs
- Frame.cs
- VisualBasicSettingsConverter.cs
- FormatPage.cs
- EasingQuaternionKeyFrame.cs
- Solver.cs
- VerificationAttribute.cs
- TheQuery.cs
- AuthenticationConfig.cs
- TraceProvider.cs
- DataServiceConfiguration.cs
- RootProfilePropertySettingsCollection.cs
- OracleCommandBuilder.cs
- HostVisual.cs
- FixedSOMPage.cs
- SendKeys.cs
- RadioButton.cs
- StylusPointDescription.cs