Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Selector.cs
- ClonableStack.cs
- IPEndPoint.cs
- WorkflowTraceTransfer.cs
- ToolStripPanel.cs
- XmlElementList.cs
- StrokeNodeOperations2.cs
- ErrorReporting.cs
- VSWCFServiceContractGenerator.cs
- Hashtable.cs
- PropertyGroupDescription.cs
- CompressEmulationStream.cs
- DescendantQuery.cs
- AssertSection.cs
- ToolbarAUtomationPeer.cs
- XmlSchemaSubstitutionGroup.cs
- CompoundFileDeflateTransform.cs
- pingexception.cs
- TextDocumentView.cs
- PeerTransportListenAddressConverter.cs
- MemberHolder.cs
- BindingExpression.cs
- BaseDataListDesigner.cs
- XmlSchemaExporter.cs
- ClientCredentials.cs
- Encoder.cs
- SelectionPatternIdentifiers.cs
- DocumentXPathNavigator.cs
- EditCommandColumn.cs
- StylusEditingBehavior.cs
- MainMenu.cs
- OwnerDrawPropertyBag.cs
- GroupBoxAutomationPeer.cs
- RewritingValidator.cs
- BaseTemplateParser.cs
- FilterQuery.cs
- XslTransformFileEditor.cs
- GroupLabel.cs
- PropertyPushdownHelper.cs
- TypeElement.cs
- DropDownList.cs
- TimeoutValidationAttribute.cs
- BCryptSafeHandles.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ThrowHelper.cs
- CaseInsensitiveComparer.cs
- HttpModulesSection.cs
- SubMenuStyle.cs
- FormViewInsertEventArgs.cs
- BinHexEncoding.cs
- LayoutTable.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- tibetanshape.cs
- HandleCollector.cs
- SymmetricAlgorithm.cs
- ObfuscationAttribute.cs
- PeerResolverMode.cs
- Compiler.cs
- HttpHandlersInstallComponent.cs
- OutputCacheModule.cs
- CommandExpr.cs
- UdpContractFilterBehavior.cs
- HashCryptoHandle.cs
- ToolStripDropDown.cs
- Item.cs
- DetailsViewRow.cs
- SamlSubject.cs
- UnsafeNativeMethodsPenimc.cs
- RemotingSurrogateSelector.cs
- SqlAggregateChecker.cs
- MethodAccessException.cs
- TextModifier.cs
- CommentEmitter.cs
- XmlRootAttribute.cs
- PrivilegeNotHeldException.cs
- CatalogZoneBase.cs
- RenameRuleObjectDialog.Designer.cs
- ManualResetEvent.cs
- GroupQuery.cs
- DecodeHelper.cs
- TdsParser.cs
- CalendarTable.cs
- LazyTextWriterCreator.cs
- CodeTryCatchFinallyStatement.cs
- GenericFlowSwitchHelper.cs
- RelationshipNavigation.cs
- DoubleAnimationBase.cs
- DataGridHelper.cs
- EventProviderWriter.cs
- AQNBuilder.cs
- ChangePasswordDesigner.cs
- FocusTracker.cs
- DelegatingConfigHost.cs
- BindingList.cs
- ClientScriptItem.cs
- AmbiguousMatchException.cs
- EventListenerClientSide.cs
- SqlComparer.cs
- OracleSqlParser.cs
- arclist.cs