dotnet / dotnet/aspnetcore

Html.DisplayFor should render Uri as hyperlink

Open
#38,821 1 comment 0 reactions 0 assignees View on GitHub
area-mvc breaking-change enhancement
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is your feature request related to a problem? Please describe.
I am trying to display an [Uri](https://docs.microsoft.com/en-us/dotnet/api/system.uri) property as a hyperlink but [DisplayFor](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.viewfeatures.htmlhelper-1.displayfor) with no template does not display it as a hyperlink.

### Describe the solution you'd like
It should not be necessary to declare the [UrlAttribute](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.urlattribute) on the property.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.