Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MetadataLocation.cs
- EntityStoreSchemaGenerator.cs
- FrameworkObject.cs
- SmtpTransport.cs
- SessionParameter.cs
- ParameterCollection.cs
- _ProxyChain.cs
- BitmapSourceSafeMILHandle.cs
- NonSerializedAttribute.cs
- InkCanvas.cs
- COM2PictureConverter.cs
- DoubleAnimationBase.cs
- ThicknessConverter.cs
- ConfigurationValue.cs
- Calendar.cs
- ToolStripManager.cs
- WebPartsPersonalizationAuthorization.cs
- Formatter.cs
- PageParser.cs
- Activity.cs
- TextEndOfParagraph.cs
- TextBoxRenderer.cs
- CuspData.cs
- RegisteredScript.cs
- PerformanceCounterPermission.cs
- HtmlAnchor.cs
- URL.cs
- Panel.cs
- ProfilePropertySettings.cs
- HttpRequestCacheValidator.cs
- PatternMatcher.cs
- TableChangeProcessor.cs
- XslTransform.cs
- log.cs
- IndexingContentUnit.cs
- ObjectDataSourceView.cs
- StringConcat.cs
- UpDownEvent.cs
- PlatformCulture.cs
- SupportsEventValidationAttribute.cs
- Range.cs
- DependencyPropertyHelper.cs
- DetailsViewPageEventArgs.cs
- DummyDataSource.cs
- NumericUpDown.cs
- IERequestCache.cs
- NameObjectCollectionBase.cs
- Bold.cs
- COAUTHINFO.cs
- Literal.cs
- MetadataCollection.cs
- Enum.cs
- AuthenticationServiceManager.cs
- VersionedStreamOwner.cs
- CfgParser.cs
- CorrelationService.cs
- UntypedNullExpression.cs
- KnownBoxes.cs
- ReachPageContentCollectionSerializerAsync.cs
- Symbol.cs
- SafeFindHandle.cs
- ComponentCommands.cs
- WebHostUnsafeNativeMethods.cs
- ResourceDictionaryCollection.cs
- CharacterShapingProperties.cs
- TabPanel.cs
- SelectedCellsChangedEventArgs.cs
- VariableQuery.cs
- FontWeightConverter.cs
- TrustLevel.cs
- ComponentConverter.cs
- PlatformCulture.cs
- XmlTextReader.cs
- UriExt.cs
- StringValueSerializer.cs
- ListBoxChrome.cs
- CookielessData.cs
- SingleKeyFrameCollection.cs
- DataTemplateSelector.cs
- TemplateBuilder.cs
- InstanceDataCollection.cs
- CatalogPartChrome.cs
- DateTimeSerializationSection.cs
- HtmlTableCell.cs
- ResourceExpressionEditorSheet.cs
- VisualTreeHelper.cs
- newinstructionaction.cs
- CompoundFileStorageReference.cs
- StickyNoteHelper.cs
- XmlBinaryReader.cs
- RootBuilder.cs
- OleDbSchemaGuid.cs
- Label.cs
- MailBnfHelper.cs
- WorkflowServiceNamespace.cs
- Attributes.cs
- RestHandler.cs
- SchemaImporterExtension.cs
- safelink.cs
- Base64Decoder.cs