GridView, HyperLinkFIeld and FILE:// URLs


I was helping a friend out this evening trying to get a simple GridView working with a HyperLinkField from a database result and we ran into an interesting security feature that people might run into:

If you add a HyperLinkField to a GridView's Columns to allow a hyperlink in a column (pretty standard), it will create hyperlinks unless the URL starts with something other than http:// and https://.  In our case, his DB has an URL of:


Because it was a full URL but didn't start with http or https, it didn't show the link. Change it to:


If you're interested, there was a Bug Report filed and MS explained why they did it:


Application Name WilderBlog Environment Name Production
Application Ver Runtime Framework .NETCoreApp,Version=v1.1
App Path D:\home\site\wwwroot Runtime Version .NET Core 4.6.25211.01
Operating System Microsoft Windows 6.2.9200 Runtime Arch X86