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
- MarkerProperties.cs
- BlockExpression.cs
- RSACryptoServiceProvider.cs
- LogicalExpr.cs
- PagerSettings.cs
- AssemblySettingAttributes.cs
- CodePageUtils.cs
- ErrorFormatter.cs
- BamlTreeNode.cs
- bidPrivateBase.cs
- ProvidersHelper.cs
- AppDomainManager.cs
- _UriTypeConverter.cs
- TextDecorationCollection.cs
- Solver.cs
- followingsibling.cs
- Repeater.cs
- ScriptMethodAttribute.cs
- QueryBranchOp.cs
- XmlSchemaCollection.cs
- TemplatePagerField.cs
- DataGridViewImageColumn.cs
- SqlConnectionHelper.cs
- PseudoWebRequest.cs
- MultiSelector.cs
- XslTransform.cs
- RemotingAttributes.cs
- InvalidFilterCriteriaException.cs
- ReferenceService.cs
- FastPropertyAccessor.cs
- SmiContextFactory.cs
- TraceData.cs
- SqlProviderManifest.cs
- QueryRewriter.cs
- Stylesheet.cs
- ParenthesizePropertyNameAttribute.cs
- designeractionlistschangedeventargs.cs
- LabelDesigner.cs
- CompoundFileStreamReference.cs
- BrowserDefinition.cs
- ProcessHost.cs
- TimeoutValidationAttribute.cs
- ValidationPropertyAttribute.cs
- BaseConfigurationRecord.cs
- ShapingEngine.cs
- DragDrop.cs
- Win32Native.cs
- CornerRadiusConverter.cs
- XmlSignificantWhitespace.cs
- QueuePathDialog.cs
- DbDeleteCommandTree.cs
- Viewport3DVisual.cs
- InstanceLockLostException.cs
- Guid.cs
- TextAction.cs
- CodeFieldReferenceExpression.cs
- SudsCommon.cs
- ConfigurationElementProperty.cs
- HtmlProps.cs
- ObfuscationAttribute.cs
- ScopelessEnumAttribute.cs
- ServiceBusyException.cs
- ActivityCompletionCallbackWrapper.cs
- ContextCorrelationInitializer.cs
- XXXInfos.cs
- WebResourceUtil.cs
- RegexRunnerFactory.cs
- linebase.cs
- AlphaSortedEnumConverter.cs
- TemplateBindingExpressionConverter.cs
- SharedStatics.cs
- EventPropertyMap.cs
- FlowDocumentReader.cs
- DefaultProfileManager.cs
- AnonymousIdentificationModule.cs
- FixUpCollection.cs
- ScopedKnownTypes.cs
- Registry.cs
- TabControl.cs
- CompiledRegexRunnerFactory.cs
- AdornerHitTestResult.cs
- AsyncStreamReader.cs
- XPathDocumentIterator.cs
- PackageFilter.cs
- DataStorage.cs
- DBConnection.cs
- FragmentQueryKB.cs
- SmiRequestExecutor.cs
- DependencyPropertyDescriptor.cs
- ModelUtilities.cs
- Table.cs
- TextPatternIdentifiers.cs
- ThicknessKeyFrameCollection.cs
- TreeView.cs
- _ScatterGatherBuffers.cs
- WebServiceTypeData.cs
- ZeroOpNode.cs
- PathSegment.cs
- RegisteredArrayDeclaration.cs
- WindowsRichEditRange.cs