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
- NetPipeSectionData.cs
- ColorMap.cs
- WpfGeneratedKnownTypes.cs
- FamilyMapCollection.cs
- Renderer.cs
- WsdlInspector.cs
- HTMLTextWriter.cs
- Point4DConverter.cs
- LayoutTableCell.cs
- StylusDownEventArgs.cs
- VisualBrush.cs
- ApplicationServicesHostFactory.cs
- Utils.cs
- SafeIUnknown.cs
- UpdatePanelTriggerCollection.cs
- XmlWrappingReader.cs
- InertiaTranslationBehavior.cs
- WebPartConnectVerb.cs
- SafeIUnknown.cs
- LockCookie.cs
- SystemPens.cs
- CaseStatementProjectedSlot.cs
- StreamingContext.cs
- PathStreamGeometryContext.cs
- LinkClickEvent.cs
- ProxyWebPartManager.cs
- HotSpot.cs
- AutomationEventArgs.cs
- SchemaMerger.cs
- RowSpanVector.cs
- Pkcs7Signer.cs
- Collection.cs
- HostedElements.cs
- NativeCppClassAttribute.cs
- CommandSet.cs
- SSmlParser.cs
- BuildProvidersCompiler.cs
- GridViewHeaderRowPresenter.cs
- SqlUnionizer.cs
- NavigatorOutput.cs
- TreePrinter.cs
- DisplayMemberTemplateSelector.cs
- ValueTypePropertyReference.cs
- SqlIdentifier.cs
- AppDomainAttributes.cs
- TransformerConfigurationWizardBase.cs
- CrossSiteScriptingValidation.cs
- UnmanagedMemoryStreamWrapper.cs
- CngUIPolicy.cs
- DataGridParentRows.cs
- BasicExpressionVisitor.cs
- CodeRemoveEventStatement.cs
- ProcessHostServerConfig.cs
- LocalBuilder.cs
- ReadOnlyHierarchicalDataSource.cs
- UnknownWrapper.cs
- loginstatus.cs
- DropShadowBitmapEffect.cs
- XpsViewerException.cs
- Boolean.cs
- TrackingWorkflowEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- Rights.cs
- CodeDirectoryCompiler.cs
- Selection.cs
- DataSourceGroupCollection.cs
- SurrogateChar.cs
- LogManagementAsyncResult.cs
- DesignerOptionService.cs
- Timer.cs
- LayoutTableCell.cs
- Invariant.cs
- Ipv6Element.cs
- XslNumber.cs
- formatter.cs
- XmlEncoding.cs
- RequestUriProcessor.cs
- IndependentAnimationStorage.cs
- DataGridLinkButton.cs
- LeftCellWrapper.cs
- HostVisual.cs
- PartitionResolver.cs
- Baml2006SchemaContext.cs
- ColorAnimationUsingKeyFrames.cs
- ConnectionProviderAttribute.cs
- SiteMapHierarchicalDataSourceView.cs
- DBCSCodePageEncoding.cs
- XmlSchemaImporter.cs
- SchemaImporterExtensionElement.cs
- PresentationSource.cs
- List.cs
- RequestCachePolicyConverter.cs
- ProfileBuildProvider.cs
- NamedPipeProcessProtocolHandler.cs
- OdbcEnvironment.cs
- _BufferOffsetSize.cs
- PromptBuilder.cs
- LinqExpressionNormalizer.cs
- CacheRequest.cs
- ApplicationTrust.cs