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
- MsmqOutputSessionChannel.cs
- GridView.cs
- ProfilePropertyNameValidator.cs
- SessionParameter.cs
- BaseTemplateCodeDomTreeGenerator.cs
- Brush.cs
- XPathParser.cs
- Int32.cs
- QuadTree.cs
- PartDesigner.cs
- ReadOnlyObservableCollection.cs
- SerializationEventsCache.cs
- RenderData.cs
- RegionData.cs
- Thickness.cs
- UInt64.cs
- DateTimeOffset.cs
- OrderedDictionaryStateHelper.cs
- CustomCredentialPolicy.cs
- ReservationCollection.cs
- WebPartManager.cs
- StateRuntime.cs
- EntityDataSourceDesigner.cs
- InternalConfigConfigurationFactory.cs
- ResXResourceReader.cs
- MenuItemBinding.cs
- PointValueSerializer.cs
- Utils.cs
- TimelineCollection.cs
- ScriptMethodAttribute.cs
- CodeLabeledStatement.cs
- XmlSchemaSimpleTypeList.cs
- CallSiteBinder.cs
- CheckBox.cs
- HtmlHistory.cs
- SqlRowUpdatingEvent.cs
- RotateTransform3D.cs
- HotSpot.cs
- CharacterShapingProperties.cs
- CngKey.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ToolStripItemImageRenderEventArgs.cs
- StylusLogic.cs
- TrackBar.cs
- AdCreatedEventArgs.cs
- RegistryPermission.cs
- LookupNode.cs
- MouseButton.cs
- BufferedGraphicsManager.cs
- WebScriptMetadataFormatter.cs
- StringBuilder.cs
- CompressEmulationStream.cs
- Publisher.cs
- SystemGatewayIPAddressInformation.cs
- ProtocolElement.cs
- MessageOperationFormatter.cs
- TreeNodeCollectionEditor.cs
- DrawingVisual.cs
- DomNameTable.cs
- ButtonBase.cs
- ListViewCancelEventArgs.cs
- HttpListenerContext.cs
- XmlAnyAttributeAttribute.cs
- NamespaceCollection.cs
- StylusSystemGestureEventArgs.cs
- Filter.cs
- Menu.cs
- HostingEnvironmentException.cs
- FixedBufferAttribute.cs
- ReadOnlyMetadataCollection.cs
- DataListCommandEventArgs.cs
- EnumMemberAttribute.cs
- Action.cs
- Main.cs
- SqlBuilder.cs
- ContourSegment.cs
- CaseInsensitiveOrdinalStringComparer.cs
- SqlServer2KCompatibilityAnnotation.cs
- QueryOptionExpression.cs
- AssemblyAttributesGoHere.cs
- ComponentSerializationService.cs
- DivideByZeroException.cs
- HttpProtocolReflector.cs
- SiteMapDataSource.cs
- CodeLinePragma.cs
- DateTimeOffset.cs
- ParameterCollection.cs
- NetStream.cs
- FreezableOperations.cs
- KeyInstance.cs
- FlowLayoutSettings.cs
- bindurihelper.cs
- XmlBindingWorker.cs
- xsdvalidator.cs
- ViewPort3D.cs
- BitmapMetadataEnumerator.cs
- MailMessageEventArgs.cs
- DataSourceHelper.cs
- TextUtf8RawTextWriter.cs
- DynamicFilterExpression.cs