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時 :
全站熱搜