Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlPagerLinkButton.cs / 1305376 / 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
- ProofTokenCryptoHandle.cs
- SQLMoney.cs
- BufferModeSettings.cs
- SymLanguageVendor.cs
- MessagePropertyVariants.cs
- TargetControlTypeCache.cs
- LocalValueEnumerator.cs
- Process.cs
- ColumnCollection.cs
- WmpBitmapDecoder.cs
- OleDbMetaDataFactory.cs
- MappingItemCollection.cs
- KeyValuePair.cs
- Matrix.cs
- PersonalizationStateInfo.cs
- HwndSource.cs
- XomlDesignerLoader.cs
- Stack.cs
- XmlArrayAttribute.cs
- CompModSwitches.cs
- ToolStripItemEventArgs.cs
- BookmarkScope.cs
- AssemblyCollection.cs
- SizeAnimationUsingKeyFrames.cs
- DataGridViewTextBoxColumn.cs
- Int32CAMarshaler.cs
- NotFiniteNumberException.cs
- XhtmlCssHandler.cs
- XmlSchemaSimpleContentRestriction.cs
- AccessViolationException.cs
- _SpnDictionary.cs
- TerminateDesigner.cs
- HttpDigestClientElement.cs
- BaseParagraph.cs
- XmlTextReaderImpl.cs
- PerspectiveCamera.cs
- DbConnectionStringBuilder.cs
- MouseGesture.cs
- ResponseStream.cs
- Pair.cs
- BindValidator.cs
- DispatcherObject.cs
- XamlRtfConverter.cs
- TagElement.cs
- Model3DGroup.cs
- PenLineCapValidation.cs
- XmlNotation.cs
- RouteParameter.cs
- Page.cs
- Overlapped.cs
- Repeater.cs
- ValidationHelpers.cs
- ModulesEntry.cs
- LoginCancelEventArgs.cs
- XmlSchemaSet.cs
- CustomValidator.cs
- DropDownList.cs
- DataControlButton.cs
- Wizard.cs
- securitycriticaldata.cs
- StickyNote.cs
- XPathParser.cs
- ApplicationManager.cs
- StackBuilderSink.cs
- UdpRetransmissionSettings.cs
- BitmapEffect.cs
- BindingBase.cs
- ModifyActivitiesPropertyDescriptor.cs
- AssemblyCache.cs
- TdsRecordBufferSetter.cs
- Latin1Encoding.cs
- ProvidePropertyAttribute.cs
- RequestCacheEntry.cs
- PersonalizationProviderCollection.cs
- Transform3DCollection.cs
- WinEventQueueItem.cs
- BaseAsyncResult.cs
- ConnectionStringsExpressionBuilder.cs
- EnumerableWrapperWeakToStrong.cs
- TemplateXamlParser.cs
- HtmlInputSubmit.cs
- MemberAccessException.cs
- DBDataPermission.cs
- OleDbRowUpdatedEvent.cs
- Pointer.cs
- XmlCustomFormatter.cs
- ToolStripDropDownClosingEventArgs.cs
- DataContractSerializerServiceBehavior.cs
- SiteMapSection.cs
- _Win32.cs
- ProxySimple.cs
- DataGridCommandEventArgs.cs
- DataPointer.cs
- BaseCollection.cs
- SortDescriptionCollection.cs
- XPathItem.cs
- XmlSerializerSection.cs
- BackStopAuthenticationModule.cs
- EmptyTextWriter.cs
- CodeTypeConstructor.cs