I have the following model property:
[DataType(DataType.EmailAddress)]
public string EmailAddress { get; set; }
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?
Thanks
To edit the anchor, select the anchored text or object, click the Anchor button on the Properties palette, and change its name in the Change Anchor dialog. To delete the anchor, click the Anchor icon and click Remove in the Change Anchor dialog. Why is there an anchor on my text box?
If you just don't want to see the anchor symbol (but you do want to keep the object), click File > Options > Display and uncheck the box for "object anchors". Was this reply helpful? Sorry this didn't help.
Click on the object next to which is the Anchor you want to remove. On the upper right side of the object, you will see the icon for the Layout Options. Click on the “In Line with Text” option. The anchor will disappear, and your image is now inline instead of floating.
You can add mailto in an anchor tag and open in the same window or new window. Get visitors to send mail immediately by clicking the link contains mailto system. If you have a mail client on your system and mailto is added to the anchor link. The mail client will automatically get opened when you click the link.
You can use one of the followings.
@Model.EmailAddress
OR
@Html.DisplayTextFor(model => model.EmailAddress)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With