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
- BuildProviderCollection.cs
- CopyOfAction.cs
- GridProviderWrapper.cs
- ZeroOpNode.cs
- FontFamily.cs
- BoundingRectTracker.cs
- AuthenticatingEventArgs.cs
- ValidationRuleCollection.cs
- Parallel.cs
- PrincipalPermission.cs
- SafeSecurityHandles.cs
- SequenceQuery.cs
- SamlAuthorizationDecisionStatement.cs
- PropertyTab.cs
- _LazyAsyncResult.cs
- EditingMode.cs
- PublisherIdentityPermission.cs
- __Error.cs
- CryptoKeySecurity.cs
- UserControl.cs
- WebPartDescription.cs
- DataGridColumnHeadersPresenter.cs
- EraserBehavior.cs
- SqlConnectionStringBuilder.cs
- TypeForwardedToAttribute.cs
- validationstate.cs
- XPathMessageContext.cs
- SynchronousChannelMergeEnumerator.cs
- DataRowComparer.cs
- MobileListItemCollection.cs
- StatusBarPanel.cs
- Rfc4050KeyFormatter.cs
- CaseInsensitiveComparer.cs
- WebScriptMetadataMessageEncoderFactory.cs
- InputScopeAttribute.cs
- MarkupCompiler.cs
- PropertyPathWorker.cs
- SystemMulticastIPAddressInformation.cs
- XmlMemberMapping.cs
- ObjectListFieldCollection.cs
- DBConnectionString.cs
- RemotingException.cs
- GeneratedCodeAttribute.cs
- X509Utils.cs
- OuterGlowBitmapEffect.cs
- OwnerDrawPropertyBag.cs
- SecurityCriticalDataForSet.cs
- SchemaAttDef.cs
- HttpFormatExtensions.cs
- ObjectDisposedException.cs
- TemplateColumn.cs
- TypeReference.cs
- StorageModelBuildProvider.cs
- GridViewSortEventArgs.cs
- ProcessHostMapPath.cs
- _RequestCacheProtocol.cs
- ApplicationDirectory.cs
- EventProviderWriter.cs
- MexHttpBindingCollectionElement.cs
- DependencyPropertyDescriptor.cs
- SolidColorBrush.cs
- EventProviderWriter.cs
- PointAnimationClockResource.cs
- OrderByQueryOptionExpression.cs
- ProfileSettingsCollection.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- CapabilitiesPattern.cs
- SecurityTokenResolver.cs
- StringArrayEditor.cs
- DelegatingTypeDescriptionProvider.cs
- HttpHandler.cs
- XmlSerializableReader.cs
- QilLiteral.cs
- BindingList.cs
- HMACSHA384.cs
- AssemblySettingAttributes.cs
- HelpFileFileNameEditor.cs
- FlowLayoutPanel.cs
- FloaterBaseParaClient.cs
- ObfuscateAssemblyAttribute.cs
- FixedFindEngine.cs
- TdsParserHelperClasses.cs
- DataFieldConverter.cs
- DefaultPrintController.cs
- ConfigurationSectionCollection.cs
- ValidationErrorEventArgs.cs
- RTLAwareMessageBox.cs
- ColorConvertedBitmapExtension.cs
- DataMisalignedException.cs
- SystemInformation.cs
- GeneralTransform3DTo2DTo3D.cs
- DocumentXmlWriter.cs
- Gdiplus.cs
- EntityWrapperFactory.cs
- ReadOnlyCollectionBase.cs
- StreamInfo.cs
- PathSegment.cs
- PnrpPermission.cs
- PeerNameRegistration.cs
- HttpRawResponse.cs