silverlight – 电子邮件超链接按钮

我试图在silverlight 4中使用超链接按钮作为mailto,如下所示:

<HyperlinkButton x:Name="hlbCustomerSupport" NavigateUri="mailto:customerservice@fofo.com" Content="customerservice@fofo.com"></HyperlinkButton>

当我在应用程序中单击它时,我得到:

Webpage error details

User Agent: Mozilla/4.0 (compatible;
MSIE 8.0; Windows NT 6.1; Trident/4.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR
3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C;
.NET4.0E) Timestamp: Wed,19 Jan 2011
14:24:29 UTC

Message: Unhandled Error in
Silverlight Application Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentException:
Content for the URI cannot be loaded.
The URI may be invalid. Parameter
name: uri at
System.Windows.Navigation.NavigationService.NavigateCore(Uri
uri,NavigationMode mode,Boolean
suppressJournalAdd,Boolean
isRedirect) at
System.Windows.Controls.Frame.Navigate(Uri
source) at
MS.Internal.NavigationHelper.TryInternalNavigate()
at
MS.Internal.NavigationHelper.Navigate(Boolean
checkUserInitiatedAction) at
System.Windows.Controls.HyperlinkButton.OnClick()
at
System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs
e) at
System.Windows.Controls.Control.OnMouseLeftButtonUp(Control
ctrl,EventArgs e) at
MS.Internal.JoltHelper.FireEvent(IntPtr
unmanagedObj,IntPtr unmanagedObjArgs,
Int32 argsTypeIndex,String eventName)

我在其他地方以编程方式执行此操作.我尝试了同样的方法,仍然得到错误.

解决方法

我想到了.有效的hyperlinkBut​​ton位于子窗口(远嵌套控件)中,而不在站点模板中的那个(Application对象的Child).因此,网站模板中的超链接按钮似乎必须指定TargetName =“_ blank”.不知道为什么会这样.

相关文章

如何在Silverlight4(XAML)中绑定IsEnabled属性?我试过简单的...
我正在编写我的第一个vb.net应用程序(但我也会在这里标记c#,...
ProcessFile()是在UIThread上运行还是在单独的线程上运行.如...
我从同行那里听说,对sharepoint的了解对职业生涯有益.我们不...
我正在尝试保存一个类我的类对象的集合.我收到一个错误说明:...
我需要根据Silverlight中的某些配置值设置给定控件的Style.我...