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 / WebParts / ZoneLinkButton.cs / 1 / ZoneLinkButton.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.ComponentModel; using System.Web.UI.WebControls; ////// [SupportsEventValidation] internal sealed class ZoneLinkButton : LinkButton { private WebZone _owner; private string _eventArgument; private string _imageUrl; public ZoneLinkButton(WebZone owner, string eventArgument) { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; _eventArgument = eventArgument; } public string ImageUrl { get { return (_imageUrl != null) ? _imageUrl : String.Empty; } set { _imageUrl = value; } } protected override PostBackOptions GetPostBackOptions() { // _owner.Page may be null in the designer if (!String.IsNullOrEmpty(_eventArgument) && _owner.Page != null) { PostBackOptions options = new PostBackOptions(_owner, _eventArgument); options.RequiresJavaScriptProtocol = true; return options; } return base.GetPostBackOptions(); } protected internal override void RenderContents(HtmlTextWriter writer) { // Copied from HyperLink.RenderContents() and modified slightly string imageUrl = ImageUrl; if (!String.IsNullOrEmpty(imageUrl)) { Image image = new Image(); // NOTE: The Url resolution happens right here, because the image is not parented // and will not be able to resolve when it tries to do so. image.ImageUrl = ResolveClientUrl(imageUrl); string toolTip = ToolTip; if (!String.IsNullOrEmpty(toolTip)) { image.ToolTip = toolTip; } string text = Text; if (!String.IsNullOrEmpty(text)) { image.AlternateText = text; } image.Page = Page; image.RenderControl(writer); } else { base.RenderContents(writer); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.ComponentModel; using System.Web.UI.WebControls; ////// [SupportsEventValidation] internal sealed class ZoneLinkButton : LinkButton { private WebZone _owner; private string _eventArgument; private string _imageUrl; public ZoneLinkButton(WebZone owner, string eventArgument) { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; _eventArgument = eventArgument; } public string ImageUrl { get { return (_imageUrl != null) ? _imageUrl : String.Empty; } set { _imageUrl = value; } } protected override PostBackOptions GetPostBackOptions() { // _owner.Page may be null in the designer if (!String.IsNullOrEmpty(_eventArgument) && _owner.Page != null) { PostBackOptions options = new PostBackOptions(_owner, _eventArgument); options.RequiresJavaScriptProtocol = true; return options; } return base.GetPostBackOptions(); } protected internal override void RenderContents(HtmlTextWriter writer) { // Copied from HyperLink.RenderContents() and modified slightly string imageUrl = ImageUrl; if (!String.IsNullOrEmpty(imageUrl)) { Image image = new Image(); // NOTE: The Url resolution happens right here, because the image is not parented // and will not be able to resolve when it tries to do so. image.ImageUrl = ResolveClientUrl(imageUrl); string toolTip = ToolTip; if (!String.IsNullOrEmpty(toolTip)) { image.ToolTip = toolTip; } string text = Text; if (!String.IsNullOrEmpty(text)) { image.AlternateText = text; } image.Page = Page; image.RenderControl(writer); } else { base.RenderContents(writer); } } } } // 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
- FormatException.cs
- OdbcErrorCollection.cs
- SqlTypeSystemProvider.cs
- FlagsAttribute.cs
- ItemAutomationPeer.cs
- Variant.cs
- ListControl.cs
- WeakHashtable.cs
- FrameworkElement.cs
- HttpServerUtilityBase.cs
- webeventbuffer.cs
- ObjectDataSourceDisposingEventArgs.cs
- CreateUserWizard.cs
- ScriptManager.cs
- NotFiniteNumberException.cs
- FontUnitConverter.cs
- DefaultParameterValueAttribute.cs
- CustomErrorsSection.cs
- FixUp.cs
- TcpClientChannel.cs
- PackagePartCollection.cs
- WebEventCodes.cs
- XmlSchemaSimpleTypeUnion.cs
- DataColumnMappingCollection.cs
- RotateTransform3D.cs
- BaseDataListPage.cs
- ImplicitInputBrush.cs
- Visual3D.cs
- XmlILIndex.cs
- MatrixTransform.cs
- CheckBox.cs
- ToolStripStatusLabel.cs
- GCHandleCookieTable.cs
- BoolExpressionVisitors.cs
- WindowsRichEdit.cs
- VersionPair.cs
- BuilderPropertyEntry.cs
- DataViewManagerListItemTypeDescriptor.cs
- AsyncDataRequest.cs
- WorkflowOperationErrorHandler.cs
- MasterPageParser.cs
- ExpressionPrefixAttribute.cs
- LeaseManager.cs
- ToolStripItemEventArgs.cs
- ClientTarget.cs
- CertificateManager.cs
- HMACSHA512.cs
- SingleAnimationUsingKeyFrames.cs
- TextSelectionHighlightLayer.cs
- SqlBinder.cs
- SqlUnionizer.cs
- ListViewInsertionMark.cs
- NativeObjectSecurity.cs
- ZoneMembershipCondition.cs
- ChainOfDependencies.cs
- DateTimeStorage.cs
- SimplePropertyEntry.cs
- ScrollData.cs
- Delay.cs
- ToolStripTextBox.cs
- CodeDirectionExpression.cs
- ConstNode.cs
- SQLInt16.cs
- DataContractSerializerElement.cs
- ConnectionPoolManager.cs
- OverlappedContext.cs
- RelatedPropertyManager.cs
- WorkflowServiceBuildProvider.cs
- FileEnumerator.cs
- RightsManagementInformation.cs
- UserControlDesigner.cs
- X509ChainElement.cs
- TextContainerChangeEventArgs.cs
- SwitchExpression.cs
- BoundingRectTracker.cs
- XamlBrushSerializer.cs
- TableProvider.cs
- View.cs
- WebRequestModuleElement.cs
- ApplicationInfo.cs
- QuadraticEase.cs
- SpellerInterop.cs
- ContextBase.cs
- IisHelper.cs
- XXXOnTypeBuilderInstantiation.cs
- NativeMethods.cs
- InheritanceContextChangedEventManager.cs
- AdapterUtil.cs
- QualifierSet.cs
- PlanCompiler.cs
- CompilationSection.cs
- RegistrySecurity.cs
- Run.cs
- ApplicationActivator.cs
- ConfigurationSectionGroupCollection.cs
- WebColorConverter.cs
- BinaryWriter.cs
- TextBlock.cs
- DataServices.cs
- ControlEvent.cs