Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UrlMappingsModule.cs
- HttpRawResponse.cs
- XpsException.cs
- DropShadowEffect.cs
- KeyboardNavigation.cs
- DocumentReference.cs
- Rotation3DKeyFrameCollection.cs
- AutomationTextAttribute.cs
- XmlSchemaAttributeGroup.cs
- JsonWriter.cs
- Policy.cs
- ProfessionalColorTable.cs
- SecurityUniqueId.cs
- ZipIOLocalFileHeader.cs
- NativeMethods.cs
- HiddenField.cs
- RolePrincipal.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- CompilerTypeWithParams.cs
- FileLevelControlBuilderAttribute.cs
- TextSelection.cs
- baseshape.cs
- TabControlEvent.cs
- SettingsPropertyValueCollection.cs
- WriteFileContext.cs
- OverloadGroupAttribute.cs
- FacetEnabledSchemaElement.cs
- RequestCacheEntry.cs
- XmlTextReaderImpl.cs
- LayoutTable.cs
- XPathQueryGenerator.cs
- TextDecoration.cs
- EmptyEnumerable.cs
- _LoggingObject.cs
- AnnouncementInnerClient11.cs
- ToolStripSplitStackLayout.cs
- CapabilitiesAssignment.cs
- DataStorage.cs
- QueuePropertyVariants.cs
- XmlCountingReader.cs
- PopupControlService.cs
- ObjectContextServiceProvider.cs
- PerfCounters.cs
- _KerberosClient.cs
- Vector3DAnimation.cs
- CodeMemberProperty.cs
- LayoutEvent.cs
- DependencyPropertyKey.cs
- Vector.cs
- DbParameterCollection.cs
- TextServicesPropertyRanges.cs
- ProfessionalColorTable.cs
- ApplicationDirectory.cs
- COM2FontConverter.cs
- EditorPartChrome.cs
- mediaclock.cs
- Marshal.cs
- BamlRecordHelper.cs
- OdbcConnectionHandle.cs
- MetaModel.cs
- RawStylusSystemGestureInputReport.cs
- ToolBarOverflowPanel.cs
- SoapEnumAttribute.cs
- TextBoxDesigner.cs
- ExceptionNotification.cs
- Formatter.cs
- RegistrationServices.cs
- DesignerImageAdapter.cs
- LinkArea.cs
- PEFileReader.cs
- CanonicalFontFamilyReference.cs
- TreeView.cs
- GPRECT.cs
- DuplicateContext.cs
- CodeMemberField.cs
- ProfileGroupSettingsCollection.cs
- ServiceElement.cs
- XmlObjectSerializerWriteContext.cs
- GenericFlowSwitchHelper.cs
- ModelPerspective.cs
- BamlTreeMap.cs
- FileRecordSequenceCompletedAsyncResult.cs
- RtfToXamlLexer.cs
- RemoveStoryboard.cs
- FlowNode.cs
- LineMetrics.cs
- DiagnosticsConfiguration.cs
- PropertyItem.cs
- FileVersionInfo.cs
- SchemaSetCompiler.cs
- TextModifierScope.cs
- TabPage.cs
- WindowsButton.cs
- ApplicationInfo.cs
- BufferModesCollection.cs
- FixedDocumentPaginator.cs
- SplineKeyFrames.cs
- BehaviorEditorPart.cs
- DocumentOrderComparer.cs
- ChineseLunisolarCalendar.cs