Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- InterleavedZipPartStream.cs
- BaseCollection.cs
- PolicyLevel.cs
- Odbc32.cs
- NetworkStream.cs
- CommentEmitter.cs
- _ShellExpression.cs
- WebPartCollection.cs
- Positioning.cs
- HtmlTextArea.cs
- ProviderUtil.cs
- ZeroOpNode.cs
- PropertyEntry.cs
- TextBox.cs
- ModelFactory.cs
- User.cs
- ExpressionWriter.cs
- CurrentChangedEventManager.cs
- ObjectListCommandEventArgs.cs
- RuntimeConfigLKG.cs
- BreakRecordTable.cs
- CollectionContainer.cs
- SamlConditions.cs
- ToolboxDataAttribute.cs
- FontStretches.cs
- VirtualDirectoryMappingCollection.cs
- ResourceAttributes.cs
- XmlStreamStore.cs
- LinkArea.cs
- ListViewInsertionMark.cs
- LinkTarget.cs
- TextRange.cs
- WebDescriptionAttribute.cs
- SoapHeaderAttribute.cs
- WindowsGrip.cs
- ExtentKey.cs
- SelectorItemAutomationPeer.cs
- WebConfigManager.cs
- HtmlTableCell.cs
- PackageFilter.cs
- RootNamespaceAttribute.cs
- HtmlHistory.cs
- DetailsViewModeEventArgs.cs
- GridViewDeletedEventArgs.cs
- XmlUtil.cs
- DirectoryInfo.cs
- graph.cs
- OracleString.cs
- NamespaceCollection.cs
- BindingBase.cs
- OracleBoolean.cs
- PositiveTimeSpanValidatorAttribute.cs
- TextTrailingCharacterEllipsis.cs
- SchemaNotation.cs
- WindowsImpersonationContext.cs
- CompModSwitches.cs
- BamlResourceContent.cs
- ConfigurationLoader.cs
- GridItemCollection.cs
- XamlSerializerUtil.cs
- RectangleConverter.cs
- EntityContainer.cs
- QueryAccessibilityHelpEvent.cs
- Span.cs
- TextServicesPropertyRanges.cs
- ArraySubsetEnumerator.cs
- propertytag.cs
- ProfileGroupSettingsCollection.cs
- tooltip.cs
- ContentElement.cs
- XmlWhitespace.cs
- GlyphInfoList.cs
- DataGridLengthConverter.cs
- ProfileParameter.cs
- EdmType.cs
- ExceptionNotification.cs
- HttpCookiesSection.cs
- ToolStripPanelRenderEventArgs.cs
- FeatureSupport.cs
- ManifestSignedXml.cs
- XmlSchemaAttribute.cs
- SoapAttributeAttribute.cs
- DataGridViewCellLinkedList.cs
- SerTrace.cs
- DataPointer.cs
- GlobalProxySelection.cs
- EdgeModeValidation.cs
- TextParagraphCache.cs
- log.cs
- XmlEnumAttribute.cs
- DataPagerCommandEventArgs.cs
- JsonSerializer.cs
- ForwardPositionQuery.cs
- DataGridViewControlCollection.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- TracedNativeMethods.cs
- Rectangle.cs
- Composition.cs
- AsyncStreamReader.cs
- AccessedThroughPropertyAttribute.cs