asp.net mvc - Writing External URLS from Database with Razor -


a easy question. getting started mvc. have external url's stored in database. following line of markup renders link www.google.com localhost/home/www.google.com

<a href="@item.url" target="_blank">@html.displayfor(modelitem => item.title)</a> 

where going wrong

cheers

it doesn't render way since have no protocol http:// or http:// in front of it.. thinks path based on current page. - append protocol in front of it


Comments