Writing External URLS from Database with Razor
A very easy que开发者_如何学Cstion. I am just getting started with MVC. I have external URL's stored in my database. The following line of markup renders the link www.google.com as localhost/Home/www.google.com
<a href="@item.URL" target="_blank">@Html.DisplayFor(modelItem => item.Title)</a>
Where am I going wrong
Cheers
It doesn't actually render that way but since you have no protocol http:// or http:// in front of it.. it thinks it is a path based on your current page. So - append a protocol in front of it
精彩评论