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
- TemplateBuilder.cs
- SelectionManager.cs
- ConditionalAttribute.cs
- HttpRequest.cs
- ReferenceEqualityComparer.cs
- BulletedList.cs
- Stacktrace.cs
- SplitterDesigner.cs
- AuthorizationRuleCollection.cs
- glyphs.cs
- ExpressionPrefixAttribute.cs
- Message.cs
- TemplateContainer.cs
- ColumnCollection.cs
- SqlNotificationRequest.cs
- ProvidePropertyAttribute.cs
- mediapermission.cs
- PriorityItem.cs
- DocumentGridContextMenu.cs
- WebPartManagerDesigner.cs
- DataObjectCopyingEventArgs.cs
- PropertyNames.cs
- TrackingProvider.cs
- DataFieldConverter.cs
- CollectionChangeEventArgs.cs
- InheritanceContextHelper.cs
- _DisconnectOverlappedAsyncResult.cs
- RuntimeWrappedException.cs
- FederatedMessageSecurityOverHttpElement.cs
- CroppedBitmap.cs
- Attributes.cs
- DiagnosticStrings.cs
- TearOffProxy.cs
- ConnectionConsumerAttribute.cs
- ActivityXRefConverter.cs
- MessageDispatch.cs
- WebPartConnectVerb.cs
- Timeline.cs
- Event.cs
- Expression.DebuggerProxy.cs
- ScriptControlManager.cs
- SafeCertificateContext.cs
- WebPartZoneBase.cs
- RadioButtonPopupAdapter.cs
- DesignerTransaction.cs
- StaticFileHandler.cs
- ClientReliableChannelBinder.cs
- DataControlCommands.cs
- UseLicense.cs
- TextAdaptor.cs
- XmlAttribute.cs
- UnhandledExceptionEventArgs.cs
- ContentElementAutomationPeer.cs
- IndexOutOfRangeException.cs
- RotateTransform3D.cs
- OrderedDictionary.cs
- ActivityScheduledRecord.cs
- CodeExpressionStatement.cs
- ChineseLunisolarCalendar.cs
- SchemaObjectWriter.cs
- SamlEvidence.cs
- DataControlFieldCell.cs
- DesignerTransactionCloseEvent.cs
- SmtpSection.cs
- ArrayListCollectionBase.cs
- NameValueSectionHandler.cs
- JsonObjectDataContract.cs
- InputLanguageSource.cs
- HwndTarget.cs
- CaseInsensitiveComparer.cs
- ExeConfigurationFileMap.cs
- DesignerHelpers.cs
- TextRunTypographyProperties.cs
- TraceSwitch.cs
- OleDbError.cs
- ButtonField.cs
- DynamicUpdateCommand.cs
- Message.cs
- DataStorage.cs
- AdornerLayer.cs
- HttpResponse.cs
- DefinitionProperties.cs
- SecurityHelper.cs
- RawStylusActions.cs
- FileReservationCollection.cs
- SevenBitStream.cs
- NotSupportedException.cs
- VerticalAlignConverter.cs
- WebBrowserNavigatedEventHandler.cs
- WebConfigurationHostFileChange.cs
- TitleStyle.cs
- ToolStripDropDownButton.cs
- Model3DGroup.cs
- CodeNamespaceCollection.cs
- CodeIdentifiers.cs
- EncryptedReference.cs
- NativeWrapper.cs
- BulletedListEventArgs.cs
- HttpHandlersSection.cs
- OuterGlowBitmapEffect.cs