Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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; } } } } } } // 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 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; } } } } } } // 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
- BlurBitmapEffect.cs
- MediaContext.cs
- Publisher.cs
- ping.cs
- CallbackHandler.cs
- ScriptResourceHandler.cs
- Choices.cs
- XmlHierarchicalDataSourceView.cs
- ViewManager.cs
- PlatformNotSupportedException.cs
- ClientConvert.cs
- DocumentApplicationJournalEntry.cs
- DataObjectPastingEventArgs.cs
- ConfigurationSchemaErrors.cs
- DesignerForm.cs
- ClientFormsIdentity.cs
- FieldInfo.cs
- RelatedPropertyManager.cs
- HtmlInputFile.cs
- FileLogRecordHeader.cs
- QueryValue.cs
- LogEntrySerializationException.cs
- ConstructorExpr.cs
- OLEDB_Util.cs
- AssemblyResourceLoader.cs
- RangeValidator.cs
- PreProcessor.cs
- TimeoutValidationAttribute.cs
- OpenTypeCommon.cs
- StreamInfo.cs
- Baml6ConstructorInfo.cs
- ReliabilityContractAttribute.cs
- SecurityPolicySection.cs
- ServiceReference.cs
- SettingsBindableAttribute.cs
- Page.cs
- ServiceModelDictionary.cs
- ACE.cs
- PrintControllerWithStatusDialog.cs
- RsaKeyGen.cs
- ModelItemDictionaryImpl.cs
- ClientOperation.cs
- ArraySubsetEnumerator.cs
- AuthenticationModuleElement.cs
- Action.cs
- GeometryHitTestParameters.cs
- FilterQueryOptionExpression.cs
- EditorZoneDesigner.cs
- SqlDependencyListener.cs
- CreatingCookieEventArgs.cs
- CachedFontFace.cs
- SmtpSection.cs
- SmiSettersStream.cs
- DocumentPageHost.cs
- CodeSnippetTypeMember.cs
- BehaviorEditorPart.cs
- TypeDelegator.cs
- Win32Native.cs
- _CommandStream.cs
- SelectionItemPattern.cs
- altserialization.cs
- Point4D.cs
- RijndaelManagedTransform.cs
- VoiceSynthesis.cs
- AmbiguousMatchException.cs
- ProviderConnectionPointCollection.cs
- GridViewDeletedEventArgs.cs
- WebPageTraceListener.cs
- CopyEncoder.cs
- XmlHierarchicalDataSourceView.cs
- MasterPageBuildProvider.cs
- WebConfigurationManager.cs
- GorillaCodec.cs
- CacheMemory.cs
- cookiecontainer.cs
- FeedUtils.cs
- ErrorLog.cs
- ToolStripContentPanel.cs
- MissingManifestResourceException.cs
- WindowsGraphicsCacheManager.cs
- ExpressionBuilder.cs
- ListViewItemSelectionChangedEvent.cs
- CategoryNameCollection.cs
- XmlObjectSerializerWriteContextComplex.cs
- ExtensibleClassFactory.cs
- SeverityFilter.cs
- CompatibleComparer.cs
- MiniAssembly.cs
- FixedFindEngine.cs
- CharacterMetrics.cs
- MethodImplAttribute.cs
- WebBrowserPermission.cs
- SnapshotChangeTrackingStrategy.cs
- TransformerTypeCollection.cs
- NameTable.cs
- InheritablePropertyChangeInfo.cs
- DynamicAttribute.cs
- DependencyPropertyChangedEventArgs.cs
- Gdiplus.cs
- XmlAttributes.cs