Reputation: 2291
I have a row on my website (MVC)
<td width="80%" align="left"><%: Html.DisplayFor(model => model.Website)%></td>
And I want to couple a hyperlink on that row. How can I create a hyperlink for the referring website?
Upvotes: 0
Views: 117
Reputation: 75073
Just use a normal anchor <a>
tag
<td width="80%" align="left">
<a href="<%: model.Website %>" target="_blank"><%: model.Website %></a>
</td>
if your value
does not have http
at the beginning, just manually add it, like:
<a href="http://<%: model.Website %>" ...
Upvotes: 3
Reputation: 35106
You can create display template for that if you want to be fancy or you have a lot of links on your site. See example for that: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html
Upvotes: 2