Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlImageButton.cs / 1305376 / 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
- ListDictionaryInternal.cs
- LiteralDesigner.cs
- PersistenceProviderFactory.cs
- BuildDependencySet.cs
- ObjectTag.cs
- GPStream.cs
- ThicknessAnimationBase.cs
- LassoSelectionBehavior.cs
- TableSectionStyle.cs
- newinstructionaction.cs
- XmlSchemaAny.cs
- TextRunCacheImp.cs
- IntSecurity.cs
- RegisteredHiddenField.cs
- DrawingCollection.cs
- ParallelDesigner.cs
- StringArrayConverter.cs
- ResourcePermissionBaseEntry.cs
- PropertyPathWorker.cs
- SiteMapDataSource.cs
- FlowNode.cs
- PropertyChangedEventManager.cs
- DataSvcMapFile.cs
- CorePropertiesFilter.cs
- InputLangChangeEvent.cs
- Glyph.cs
- RouteItem.cs
- sapiproxy.cs
- ApplicationInfo.cs
- ButtonFlatAdapter.cs
- VectorCollectionValueSerializer.cs
- InheritanceContextHelper.cs
- IPEndPointCollection.cs
- XmlNavigatorFilter.cs
- DataGridViewRowPostPaintEventArgs.cs
- DataServiceExpressionVisitor.cs
- AutoGeneratedField.cs
- StringFreezingAttribute.cs
- NativeMethods.cs
- CaseStatementProjectedSlot.cs
- DrawingImage.cs
- MonthCalendar.cs
- FileChangesMonitor.cs
- DesignerActionMethodItem.cs
- DiagnosticsConfigurationHandler.cs
- EventProviderWriter.cs
- ResourcesBuildProvider.cs
- ProcessRequestAsyncResult.cs
- SafeRightsManagementSessionHandle.cs
- AuthenticationConfig.cs
- COM2FontConverter.cs
- UdpChannelListener.cs
- ObjRef.cs
- MaterializeFromAtom.cs
- TextDocumentView.cs
- SystemIcmpV4Statistics.cs
- EntityTypeBase.cs
- WSDualHttpBindingCollectionElement.cs
- ApplicationId.cs
- BreakRecordTable.cs
- NotifyParentPropertyAttribute.cs
- WebServiceHandler.cs
- DocumentStatusResources.cs
- HtmlTableCell.cs
- BitmapPalettes.cs
- GreenMethods.cs
- DPAPIProtectedConfigurationProvider.cs
- Binding.cs
- TableLayoutSettings.cs
- HyperLink.cs
- InternalSendMessage.cs
- CubicEase.cs
- AsyncResult.cs
- IsolatedStorageException.cs
- WebResponse.cs
- ClientSettingsSection.cs
- UniqueIdentifierService.cs
- UIElementIsland.cs
- KoreanLunisolarCalendar.cs
- PersonalizationStateQuery.cs
- CompositeActivityValidator.cs
- AuthenticateEventArgs.cs
- CompiledXpathExpr.cs
- FileDialogCustomPlacesCollection.cs
- ListViewItem.cs
- ADConnectionHelper.cs
- TypeBuilder.cs
- TranslateTransform.cs
- XmlCustomFormatter.cs
- TransformPattern.cs
- UserInitiatedNavigationPermission.cs
- HttpCacheVary.cs
- XmlSerializableServices.cs
- RemoteWebConfigurationHostStream.cs
- AssemblyAttributesGoHere.cs
- XmlArrayAttribute.cs
- UserPersonalizationStateInfo.cs
- SqlDataSourceCommandEventArgs.cs
- HttpGetServerProtocol.cs
- ZipIOModeEnforcingStream.cs