asp.net - Hyperlink in MVC3 -



asp.net - Hyperlink in MVC3 -

i have in mvc3 razor.. want create hyperlink..so users can click on it. right prints text of url in view.. help.

<td> @html.displayfor(modelitem => item.weblink) </td>

thanks richard, heres solution..

@{ var link = @item.weblink; if (link != null) { if (!link.startswith("http://")) { link = "http://"+link; } } } <a href="@link">@item.weblink</a>

you should try:

<a href="@item.weblink">@item.weblink</a>

ok comment need this:

@{ var link = @item.weblink; if (!link.startswith("http://")) { link = "http://"+link; } } <a href="@link">@item.weblink</a>

asp.net asp.net-mvc asp.net-mvc-3 razor

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -