开发者

Displaying user website link in view

开发者 https://www.devze.com 2022-12-10 05:44 出处:网络
Is this fine or is开发者_StackOverflow社区 there a different way? <a href=\"Http://<%=Html.Encode(Model.Website)%>\"><%=Html.Encode(Model.Website??\"\")%></a>

Is this fine or is开发者_StackOverflow社区 there a different way?

 <a href="Http://<%=Html.Encode(Model.Website)%>"><%=Html.Encode(Model.Website??"")%></a>


Seems fine to me, although you might want to check that the website doesn't already start with "http://" as well.


You could write a custom HTML Helper to do it for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消