Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / ZoneLinkButton.cs / 2 / 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(); // 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. //------------------------------------------------------------------------------ //// 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(); // 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ModelItemDictionaryImpl.cs
- Canonicalizers.cs
- IndexerNameAttribute.cs
- SpotLight.cs
- EncoderExceptionFallback.cs
- ReadOnlyDataSourceView.cs
- XmlAttributeCache.cs
- ToolStripSplitButton.cs
- RelationshipNavigation.cs
- Point3D.cs
- XmlILTrace.cs
- Ipv6Element.cs
- CorrelationTokenInvalidatedHandler.cs
- MemberHolder.cs
- OverrideMode.cs
- CorrelationActionMessageFilter.cs
- GetImportFileNameRequest.cs
- Filter.cs
- OrthographicCamera.cs
- XamlVector3DCollectionSerializer.cs
- DoubleAnimationUsingPath.cs
- SqlDataSourceQueryEditor.cs
- RangeBase.cs
- EmbeddedObject.cs
- GenericUriParser.cs
- BufferModesCollection.cs
- ClientScriptManager.cs
- DataControlFieldHeaderCell.cs
- MruCache.cs
- FormatConvertedBitmap.cs
- InheritanceContextHelper.cs
- WebPartCollection.cs
- QilCloneVisitor.cs
- TextRenderer.cs
- FontNamesConverter.cs
- SafeViewOfFileHandle.cs
- ArrayEditor.cs
- StagingAreaInputItem.cs
- TextWriterEngine.cs
- ChineseLunisolarCalendar.cs
- RawStylusInputCustomData.cs
- DocumentApplicationJournalEntry.cs
- WorkflowDefinitionContext.cs
- BStrWrapper.cs
- Parameter.cs
- UTF7Encoding.cs
- InvalidTimeZoneException.cs
- DependencyPropertyChangedEventArgs.cs
- AuthenticationServiceManager.cs
- ParallelEnumerable.cs
- XmlnsCompatibleWithAttribute.cs
- PropertyEntry.cs
- QilReference.cs
- CheckBoxStandardAdapter.cs
- ParserOptions.cs
- TraceContext.cs
- MetadataCollection.cs
- ReflectionHelper.cs
- EventToken.cs
- ColorContext.cs
- RecordConverter.cs
- WeakReadOnlyCollection.cs
- connectionpool.cs
- TraceListeners.cs
- ParameterExpression.cs
- ActionFrame.cs
- DetailsViewInsertedEventArgs.cs
- ConfigXmlElement.cs
- OperationCanceledException.cs
- BaseTemplateBuildProvider.cs
- ListControl.cs
- BmpBitmapDecoder.cs
- WeakHashtable.cs
- _FixedSizeReader.cs
- DateTimeStorage.cs
- MouseButton.cs
- StateElement.cs
- XmlNodeChangedEventArgs.cs
- SQLMembershipProvider.cs
- TextDpi.cs
- ToolStripLabel.cs
- DeflateEmulationStream.cs
- ElementMarkupObject.cs
- Input.cs
- ProviderCollection.cs
- SystemUdpStatistics.cs
- TemplatePartAttribute.cs
- FileLevelControlBuilderAttribute.cs
- CompiledQuery.cs
- MatrixStack.cs
- SoapProtocolReflector.cs
- EntityContainerEmitter.cs
- WriterOutput.cs
- DataGridViewCellValueEventArgs.cs
- IndexOutOfRangeException.cs
- MonthCalendar.cs
- HandleRef.cs
- HtmlElementEventArgs.cs
- TableCellAutomationPeer.cs
- WinFormsUtils.cs