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
- SqlErrorCollection.cs
- SqlDataReaderSmi.cs
- FacetDescription.cs
- OuterGlowBitmapEffect.cs
- Geometry.cs
- Speller.cs
- BaseDataList.cs
- XmlWellformedWriter.cs
- GridViewColumnHeader.cs
- DataListItemCollection.cs
- Stroke.cs
- FtpCachePolicyElement.cs
- SQLBoolean.cs
- WebPartZoneBaseDesigner.cs
- Rect3DValueSerializer.cs
- HashStream.cs
- DoubleCollectionConverter.cs
- EmptyReadOnlyDictionaryInternal.cs
- DataGridViewBindingCompleteEventArgs.cs
- EncodingTable.cs
- ExceptionHelpers.cs
- DataControlButton.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- LocalValueEnumerator.cs
- formatstringdialog.cs
- ResourceSetExpression.cs
- HtmlInputHidden.cs
- iisPickupDirectory.cs
- ViewLoader.cs
- _DomainName.cs
- DeclaredTypeElementCollection.cs
- Rule.cs
- ComponentChangingEvent.cs
- BinaryFormatter.cs
- DataGridViewRowPostPaintEventArgs.cs
- PointLightBase.cs
- SafeCryptHandles.cs
- Menu.cs
- FloatAverageAggregationOperator.cs
- TargetControlTypeCache.cs
- EnumMemberAttribute.cs
- SendMailErrorEventArgs.cs
- OracleMonthSpan.cs
- DiagnosticStrings.cs
- Grid.cs
- safelinkcollection.cs
- InstanceDataCollectionCollection.cs
- ListViewCancelEventArgs.cs
- PerspectiveCamera.cs
- regiisutil.cs
- OdbcConnectionHandle.cs
- WeakHashtable.cs
- WizardForm.cs
- XmlParserContext.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- _LoggingObject.cs
- CorrelationService.cs
- Int32RectValueSerializer.cs
- SHA384.cs
- ChannelHandler.cs
- XsltContext.cs
- SurrogateEncoder.cs
- NodeInfo.cs
- DbProviderFactory.cs
- CmsInterop.cs
- WebControlAdapter.cs
- ThrowHelper.cs
- IdleTimeoutMonitor.cs
- RequestQueue.cs
- GridViewDeleteEventArgs.cs
- ParsedAttributeCollection.cs
- AdornerPresentationContext.cs
- ChangeBlockUndoRecord.cs
- GridViewRow.cs
- SourceFileInfo.cs
- ServiceBusyException.cs
- ImageSourceValueSerializer.cs
- HttpHeaderCollection.cs
- PolygonHotSpot.cs
- VarRefManager.cs
- WindowsImpersonationContext.cs
- ComponentEditorForm.cs
- TextTreeRootTextBlock.cs
- ComPlusInstanceContextInitializer.cs
- OverlappedAsyncResult.cs
- ArraySortHelper.cs
- RuleSettingsCollection.cs
- ApplicationCommands.cs
- TabRenderer.cs
- SortedDictionary.cs
- WindowsFormsSynchronizationContext.cs
- ParameterBuilder.cs
- TreeNodeBinding.cs
- ParameterModifier.cs
- RedistVersionInfo.cs
- AutoCompleteStringCollection.cs
- SmiContextFactory.cs
- GetCardDetailsRequest.cs
- TypeToArgumentTypeConverter.cs
- WorkflowCommandExtensionItem.cs