dhl:Url.Action和Html.ActionLink当有两个参数时:生成Html 代码中&字符的区别:Url.Action不会转义。
快速购买:
<a href="<%=Url.Action("Buy", "Shop", new { ShopType = Convert.ToInt32(shop.Type), ID = shop.ID, MoneyType = "Golden", BuyNum = 1 })%>">1</a>
<%=Html.ActionLink("1","Buy", "Shop", new { ShopType = Convert.ToInt32(shop.Type), ID = shop.ID, MoneyType = "Golden", BuyNum = 1 },null) %>
<a href="<%=Url.Action("Buy", "Shop", new { ShopType = Convert.ToInt32(shop.Type), ID = shop.ID, MoneyType = "Golden", BuyNum = 1 })%>">1</a>
<%=Html.ActionLink("1","Buy", "Shop", new { ShopType = Convert.ToInt32(shop.Type), ID = shop.ID, MoneyType = "Golden", BuyNum = 1 },null) %>
HTML后:
快速购买:
<a href="/Shop.mvc/Buy/1?ShopType=1&MoneyType=Golden&BuyNum=1">1</a>
<a href="/Shop.mvc/Buy/1?ShopType=1&MoneyType=Golden&BuyNum=1">1</a>