Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlPagerLinkButton.cs / 1 / DataControlPagerLinkButton.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 LinkButton used within a DataControl. /// [SupportsEventValidation] internal class DataControlPagerLinkButton : DataControlLinkButton { internal DataControlPagerLinkButton(IPostBackContainer container) : base(container) { } public override bool CausesValidation { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.CannotSetValidationOnPagerButtons)); } } ////// In HTML hyperlinks always use the browser's link color. /// For the DataControl, we want all LinkButtons to honor the ForeColor setting. /// This requires looking up into the control hierarchy to see if either the cell /// or the containing row or table define a ForeColor. /// protected override void SetForeColor() { if (ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FORECOLOR) == false) { Color hyperLinkForeColor; Control control = this; for (int i = 0; i < 6; i++) { control = control.Parent; // pager buttons are usually inside a table that's inside the pager row Debug.Assert(((i == 0) && (control is TableCell)) || ((i == 1) && (control is TableRow)) || ((i == 2) && (control is Table)) || ((i == 3) && (control is TableCell)) || ((i == 4) && (control is TableRow)) || ((i == 5) && (control is Table))); hyperLinkForeColor = ((WebControl)control).ForeColor; if (hyperLinkForeColor != Color.Empty) { ForeColor = hyperLinkForeColor; break; } } } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowExtensionMethods.cs
- DesignTimeVisibleAttribute.cs
- Misc.cs
- WindowClosedEventArgs.cs
- _HeaderInfoTable.cs
- WindowsAuthenticationEventArgs.cs
- ClientData.cs
- XamlClipboardData.cs
- SQLGuidStorage.cs
- safelinkcollection.cs
- NotifyIcon.cs
- DecoderFallback.cs
- Library.cs
- HttpValueCollection.cs
- CheckBoxField.cs
- WorkflowServiceHostFactory.cs
- WindowsIPAddress.cs
- SiteOfOriginPart.cs
- QilSortKey.cs
- ToolboxDataAttribute.cs
- LabelDesigner.cs
- ScriptRef.cs
- XmlAnyElementAttributes.cs
- CustomPeerResolverService.cs
- OutOfProcStateClientManager.cs
- Effect.cs
- ObjectList.cs
- RuntimeUtils.cs
- BuildProvidersCompiler.cs
- Material.cs
- Geometry3D.cs
- DataViewSettingCollection.cs
- MulticastDelegate.cs
- AppearanceEditorPart.cs
- WebServiceTypeData.cs
- SqlFunctions.cs
- WebPartDeleteVerb.cs
- DES.cs
- CompilationPass2Task.cs
- ProviderUtil.cs
- CannotUnloadAppDomainException.cs
- CLSCompliantAttribute.cs
- RSAPKCS1SignatureFormatter.cs
- ResourceSetExpression.cs
- RadioButton.cs
- PropertyGroupDescription.cs
- SafeProcessHandle.cs
- EntityDataSourceDesigner.cs
- CharAnimationBase.cs
- XmlSchemaObject.cs
- XmlSerializationReader.cs
- ToolStripSettings.cs
- Vector3DValueSerializer.cs
- AsyncResult.cs
- HttpResponseInternalBase.cs
- RegexFCD.cs
- QilUnary.cs
- _SecureChannel.cs
- Screen.cs
- CheckBoxList.cs
- XmlDataSource.cs
- DesignerVerb.cs
- DataGridViewCellValueEventArgs.cs
- FontSource.cs
- ProcessInfo.cs
- ListManagerBindingsCollection.cs
- DateTimePicker.cs
- Trace.cs
- ToolboxComponentsCreatingEventArgs.cs
- Vector3DIndependentAnimationStorage.cs
- HttpWriter.cs
- IgnoreFileBuildProvider.cs
- PaperSize.cs
- GradientStop.cs
- AncillaryOps.cs
- KeyValuePair.cs
- Activator.cs
- WebPartEditVerb.cs
- TextFormatterContext.cs
- RuleAction.cs
- SendKeys.cs
- ToggleProviderWrapper.cs
- SplashScreenNativeMethods.cs
- InfoCardXmlSerializer.cs
- MsmqProcessProtocolHandler.cs
- MouseButtonEventArgs.cs
- ComAdminInterfaces.cs
- HTTPNotFoundHandler.cs
- XmlSchemaSet.cs
- ActiveXHelper.cs
- WindowsGraphics.cs
- MetabaseReader.cs
- FunctionUpdateCommand.cs
- QuestionEventArgs.cs
- ContentOperations.cs
- XmlWrappingReader.cs
- StyleCollection.cs
- SecurityUtils.cs
- UIElement3D.cs
- IApplicationTrustManager.cs