veiw engine:Razor

希望透過 Action 或 RouteUrl 產生url連結時:

@Url.Action("Index", "Home")
@Url.RouteUrl("Default", new {controller="Home", action="Index"}) 

如果需產生 "http://" 開頭的絕對位置:

@Url.Action("Index", "Home", null, "http"
@Url.RouteUrl("Default", new {controller="Home", action="Index"}, "http")

例子,有個回到首頁的連結需在中間放入img時 :

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 湯瑪的吳 的頭像
    湯瑪的吳

    安達利機車行

    湯瑪的吳 發表在 痞客邦 留言(0) 人氣()