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
- MsmqIntegrationOutputChannel.cs
- WhitespaceRule.cs
- InputMethodStateChangeEventArgs.cs
- ToolStripPanel.cs
- BitmapEditor.cs
- AnchoredBlock.cs
- SourceFileBuildProvider.cs
- XamlParser.cs
- SafeTimerHandle.cs
- DesignerCategoryAttribute.cs
- SplashScreenNativeMethods.cs
- Accessible.cs
- WsatServiceCertificate.cs
- DeviceContexts.cs
- TransactionScope.cs
- BlockUIContainer.cs
- FacetChecker.cs
- ActivityIdHeader.cs
- StylusPointProperty.cs
- ComponentResourceKey.cs
- SchemaExporter.cs
- NamedPipeAppDomainProtocolHandler.cs
- NullExtension.cs
- DbSource.cs
- NumberSubstitution.cs
- MenuTracker.cs
- QilUnary.cs
- Double.cs
- StylusCaptureWithinProperty.cs
- EncodingTable.cs
- basenumberconverter.cs
- TreeViewItemAutomationPeer.cs
- ObjectContextServiceProvider.cs
- KeyValuePairs.cs
- FormsAuthenticationEventArgs.cs
- Transform.cs
- Hyperlink.cs
- StringReader.cs
- SoapAttributeOverrides.cs
- BamlReader.cs
- precedingquery.cs
- AutomationIdentifierGuids.cs
- CrossAppDomainChannel.cs
- XmlFormatReaderGenerator.cs
- SQLRoleProvider.cs
- FontInfo.cs
- KeyConverter.cs
- ContravarianceAdapter.cs
- XmlElement.cs
- Int16Storage.cs
- CodeThrowExceptionStatement.cs
- SHA1.cs
- TypeSchema.cs
- ProfileGroupSettings.cs
- SponsorHelper.cs
- DataBindingCollection.cs
- NavigationHelper.cs
- UnmanagedMemoryStream.cs
- CodeVariableReferenceExpression.cs
- PathData.cs
- Char.cs
- RequestResizeEvent.cs
- NCryptSafeHandles.cs
- JsonReader.cs
- InstalledVoice.cs
- VScrollProperties.cs
- BlurBitmapEffect.cs
- TextEffect.cs
- SortedList.cs
- FormatConvertedBitmap.cs
- ZoneButton.cs
- ListBox.cs
- ExtensionDataReader.cs
- XmlWhitespace.cs
- RegionInfo.cs
- IResourceProvider.cs
- Propagator.Evaluator.cs
- CompiledQuery.cs
- NullableIntMinMaxAggregationOperator.cs
- TreeViewImageKeyConverter.cs
- ParserContext.cs
- AccessorTable.cs
- SqlWebEventProvider.cs
- LinqDataSourceContextData.cs
- StaticFileHandler.cs
- KnownIds.cs
- XmlTextReader.cs
- TemplateField.cs
- WindowPattern.cs
- WebPartTransformerCollection.cs
- HMACSHA256.cs
- HotCommands.cs
- ReferentialConstraint.cs
- SmiEventSink.cs
- BindingContext.cs
- TimeSpanSecondsConverter.cs
- IPEndPoint.cs
- ExpressionList.cs
- CreateUserWizardDesigner.cs
- Fonts.cs