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
- BreakSafeBase.cs
- ThreadStartException.cs
- FileVersionInfo.cs
- ScriptingProfileServiceSection.cs
- SoapIncludeAttribute.cs
- sqlser.cs
- CombinedGeometry.cs
- TCPClient.cs
- ParamArrayAttribute.cs
- ReadWriteObjectLock.cs
- XmlIterators.cs
- SerializationIncompleteException.cs
- DoubleAnimationUsingKeyFrames.cs
- HttpCachePolicyElement.cs
- ReadOnlyDataSourceView.cs
- WindowsContainer.cs
- EventLogEntry.cs
- ComplexBindingPropertiesAttribute.cs
- Drawing.cs
- ConfigurationManagerInternalFactory.cs
- LogReserveAndAppendState.cs
- Random.cs
- XmlIncludeAttribute.cs
- CheckBoxList.cs
- PropertyChangedEventArgs.cs
- FileLevelControlBuilderAttribute.cs
- PageAdapter.cs
- CssTextWriter.cs
- StructureChangedEventArgs.cs
- HtmlInputControl.cs
- ReaderOutput.cs
- PropertyStore.cs
- GacUtil.cs
- XmlSerializer.cs
- TransformValueSerializer.cs
- SQLString.cs
- TemplatedMailWebEventProvider.cs
- Quad.cs
- DiscoveryClientDocuments.cs
- StoryFragments.cs
- UnmanagedMemoryStream.cs
- XmlElementAttributes.cs
- ExpressionBinding.cs
- OutOfMemoryException.cs
- WindowsTreeView.cs
- DataBoundControlHelper.cs
- CngProperty.cs
- LookupBindingPropertiesAttribute.cs
- XmlSchema.cs
- BamlMapTable.cs
- PagedControl.cs
- ContentHostHelper.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- QueryConverter.cs
- DataViewSettingCollection.cs
- ProfileGroupSettings.cs
- ProcessThreadDesigner.cs
- SymbolMethod.cs
- MemberInfoSerializationHolder.cs
- OleServicesContext.cs
- TrackingMemoryStreamFactory.cs
- ProcessHostServerConfig.cs
- PageStatePersister.cs
- ImageField.cs
- SortDescriptionCollection.cs
- TextTrailingCharacterEllipsis.cs
- AssemblyName.cs
- LocalizedNameDescriptionPair.cs
- ApplicationProxyInternal.cs
- SchemaElement.cs
- RecognizedWordUnit.cs
- EventProperty.cs
- OleDbRowUpdatedEvent.cs
- WebPartManagerInternals.cs
- FlowSwitch.cs
- ToolStripProgressBar.cs
- BitmapEffectGeneralTransform.cs
- Themes.cs
- DataSourceCacheDurationConverter.cs
- PermissionAttributes.cs
- Transform.cs
- NativeMethods.cs
- InternalCache.cs
- CngKeyCreationParameters.cs
- CapabilitiesUse.cs
- StrongTypingException.cs
- TagPrefixInfo.cs
- UnauthorizedWebPart.cs
- PixelFormatConverter.cs
- Timer.cs
- RowVisual.cs
- ToolStripPanel.cs
- ListGeneralPage.cs
- CompatibleComparer.cs
- DelegateArgumentReference.cs
- UserControlCodeDomTreeGenerator.cs
- GraphicsContainer.cs
- SqlParameterCollection.cs
- DataGridItem.cs
- LinkTarget.cs