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
- OutputCacheSettings.cs
- MultipartIdentifier.cs
- InfoCardProofToken.cs
- WorkerRequest.cs
- OrderedDictionary.cs
- Message.cs
- ExpressionParser.cs
- KeyInstance.cs
- ConfigXmlReader.cs
- UnrecognizedPolicyAssertionElement.cs
- RefType.cs
- ResolveMatchesCD1.cs
- PolyQuadraticBezierSegment.cs
- FrameworkContentElement.cs
- XamlStyleSerializer.cs
- SecurityRuntime.cs
- SrgsOneOf.cs
- TransformPattern.cs
- HandleCollector.cs
- EntityExpressionVisitor.cs
- TemporaryBitmapFile.cs
- TableLayoutSettings.cs
- WriteFileContext.cs
- LinkLabel.cs
- SolidColorBrush.cs
- StateManagedCollection.cs
- SortDescriptionCollection.cs
- WebBrowserUriTypeConverter.cs
- HttpCapabilitiesBase.cs
- DataControlButton.cs
- CompilerError.cs
- RoleService.cs
- MsmqReceiveParameters.cs
- FlowchartDesigner.Helpers.cs
- ContentOperations.cs
- SafeNativeMethods.cs
- SortFieldComparer.cs
- XPathQilFactory.cs
- MinMaxParagraphWidth.cs
- XmlSerializerFactory.cs
- CultureTableRecord.cs
- TextTreeUndo.cs
- AttributeConverter.cs
- Stroke2.cs
- TickBar.cs
- CodeCompileUnit.cs
- ImpersonateTokenRef.cs
- WindowsScroll.cs
- HostedHttpTransportManager.cs
- BasicCellRelation.cs
- ProcessHostMapPath.cs
- PrintDialogException.cs
- TemplateNameScope.cs
- RoleManagerSection.cs
- FrameworkElementFactoryMarkupObject.cs
- Image.cs
- ConstructorExpr.cs
- HighContrastHelper.cs
- EditorZone.cs
- SqlNotificationRequest.cs
- XsdDateTime.cs
- EntityExpressionVisitor.cs
- InkPresenterAutomationPeer.cs
- DmlSqlGenerator.cs
- Image.cs
- ListView.cs
- ClientSettings.cs
- StackSpiller.Generated.cs
- Type.cs
- BufferedGraphics.cs
- RouteCollection.cs
- CapabilitiesRule.cs
- EndpointAddressProcessor.cs
- ParameterBuilder.cs
- ClientFormsIdentity.cs
- ValueChangedEventManager.cs
- ModelItem.cs
- DirtyTextRange.cs
- AsyncCodeActivityContext.cs
- CodeAttributeArgumentCollection.cs
- Matrix3DStack.cs
- TemplateLookupAction.cs
- ConfigXmlWhitespace.cs
- UpdateProgress.cs
- ReadingWritingEntityEventArgs.cs
- DataBindingCollection.cs
- Variable.cs
- FusionWrap.cs
- RsaElement.cs
- ToolBarButton.cs
- HashHelper.cs
- DataBindingCollection.cs
- UserControlCodeDomTreeGenerator.cs
- SQLDoubleStorage.cs
- SaveFileDialog.cs
- HttpListenerTimeoutManager.cs
- XmlWrappingReader.cs
- DBSchemaRow.cs
- basenumberconverter.cs
- LineGeometry.cs