3
我试图创建一个pinterest pin它的按钮。 下面是代码:剃刀:创建pinterest字符串
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.domain.name%2Fproduct%[email protected]&media=http%3A%2F%2Fwww.domain.name%2Fproduct%[email protected]&[email protected]" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
正如你看到有三个变量:
url : http%3A%2F%2Fwww.domain.name%2Fproduct%[email protected]
media: http%3A%2F%2Fwww.domain.name%2Fproduct%[email protected]
description: @Model.ProductDetails.ProductDescription
在所有这三个变量的一些数据从视图模型使用@Model
但只有@Model.ProductDetails.ProductDescription
未来工作 另外两个不工作也许是因为它们是更大字符串的一部分。
您也可以使用@ Url.Encode来封装url,media&description属性。 – Micah