Where is @Html.MailTo in MVC 4?
Asked Answered
W

2

5

I read on many forums suggesting to use @Html.MailTo to send emails using local client (i.e similar to "mailto:" in anchor.

But when I try doing that, I simply dont find "MailTo" option in intellisense... Am I missing something, or if its obsolete now, or if its a customer HtmlHelper?

Winterize answered 7/1, 2013 at 6:8 Comment(0)
W
7

@Html.Mailto is one of the Features of ASP.NET MVC 3 Futures. ASP.NET MVC 3 Futures includes a bunch of features which may become the part of ASP.NET MVC in future.

Inorder to use it you need to download it from codeplex

You can check all the features in Imran Baloch's Blog Post

Hope it helps.

Whippet answered 7/1, 2013 at 6:47 Comment(0)
M
2

You can use @Html.DisplayFor such as @Html.DisplayFor(modelItem => Model.emailAddress) and it will produce an email link.

Matchbox answered 11/4, 2013 at 15:57 Comment(2)
Unless the model property is marked up with a helper attribute e.g. [DataType(DataTypes.EmailAddress)], you need to specify the EmailAddress DisplayTemplate explicitly e.g. @Html.DisplayFor(model => model.emailAddress, "EmailAddress")Thor
It should be DataType.EmailAddress instead of DataTypes.EmailAddressMarmoreal

© 2022 - 2024 — McMap. All rights reserved.