Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IconConverter.cs
- unsafenativemethodstextservices.cs
- UnsignedPublishLicense.cs
- RemotingConfiguration.cs
- Stylus.cs
- _NegoStream.cs
- NetStream.cs
- ObjectAnimationBase.cs
- InputGestureCollection.cs
- OdbcFactory.cs
- DoubleLinkList.cs
- HttpRuntimeSection.cs
- FixUp.cs
- NTAccount.cs
- ValidateNames.cs
- ScrollProviderWrapper.cs
- RelationshipNavigation.cs
- TemplateComponentConnector.cs
- MouseGestureValueSerializer.cs
- EventDescriptor.cs
- GenericsInstances.cs
- LocatorPart.cs
- ClassGenerator.cs
- EmptyReadOnlyDictionaryInternal.cs
- TempEnvironment.cs
- StatusStrip.cs
- LookupNode.cs
- XamlClipboardData.cs
- FontSource.cs
- ParameterToken.cs
- UnionExpr.cs
- RowUpdatedEventArgs.cs
- DefaultParameterValueAttribute.cs
- EventWaitHandle.cs
- Window.cs
- Monitor.cs
- Tokenizer.cs
- SelectionProviderWrapper.cs
- ContentDesigner.cs
- PackageFilter.cs
- SqlDependencyUtils.cs
- Scalars.cs
- WebServiceParameterData.cs
- Lasso.cs
- RadioButton.cs
- TemplatePagerField.cs
- Token.cs
- ManagementDateTime.cs
- WebBaseEventKeyComparer.cs
- ByValueEqualityComparer.cs
- InheritedPropertyDescriptor.cs
- LogicalExpr.cs
- CacheOutputQuery.cs
- CultureTableRecord.cs
- DesignerDataParameter.cs
- ApplicationActivator.cs
- UpdatePanelTriggerCollection.cs
- HttpWebRequest.cs
- DateTimeSerializationSection.cs
- ViewBase.cs
- Item.cs
- ValidationSummaryDesigner.cs
- InvalidCardException.cs
- SqlConnectionStringBuilder.cs
- InputGestureCollection.cs
- SerialPort.cs
- AssociatedControlConverter.cs
- UIPermission.cs
- RoleService.cs
- SocketInformation.cs
- TextBox.cs
- SystemMulticastIPAddressInformation.cs
- ScriptResourceInfo.cs
- WebSysDefaultValueAttribute.cs
- XmlSchemaProviderAttribute.cs
- MembershipSection.cs
- PageCache.cs
- ResourceSet.cs
- DBSqlParserColumn.cs
- XmlException.cs
- FontUnitConverter.cs
- WhitespaceRule.cs
- TextEncodedRawTextWriter.cs
- CompilerParameters.cs
- SimpleHandlerBuildProvider.cs
- ButtonBase.cs
- InfoCardArgumentException.cs
- SoapCodeExporter.cs
- InlineObject.cs
- TemplateParser.cs
- WmpBitmapEncoder.cs
- XmlSchemaGroup.cs
- PrintDialog.cs
- KeyedCollection.cs
- MonikerBuilder.cs
- WorkItem.cs
- IPGlobalProperties.cs
- WebConfigurationHost.cs
- EditorPartCollection.cs
- GifBitmapEncoder.cs