卸下DisplayFor邮寄地址锚 [英] Remove mailto anchor from DisplayFor

查看:171
本文介绍了卸下DisplayFor邮寄地址锚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下模型属性:

[DataType(DataType.EmailAddress)]
public string EmailAddress { get; set; }

当我使用displayfor:

When I use the displayfor:

@Html.DisplayFor(modelItem => item.EmailAddress)

它增加了一个邮寄地址锚文本。反正是有,我可以为它指定不包括这个?

it adds a 'mailto' anchor to the text. Is there anyway I can specify for it not to include this?

感谢

推荐答案

您可以使用下列条件之一。

You can use one of the followings.

  @Model.EmailAddress 

  @Html.DisplayTextFor(model => model.EmailAddress)

这篇关于卸下DisplayFor邮寄地址锚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆