2
我對javascript代碼:ASP MVC 2的Javascript
<script>var index=0</script>
如何傳遞它的HtmlHelper
forexample我想是這樣的:
<%Html.ActionLink("test",'+index+',"Stations")%>';
,但其明顯的不工作;
我對javascript代碼:ASP MVC 2的Javascript
<script>var index=0</script>
如何傳遞它的HtmlHelper
forexample我想是這樣的:
<%Html.ActionLink("test",'+index+',"Stations")%>';
,但其明顯的不工作;
您無法將JavaScript變量傳遞給HTML幫助程序,因爲此幫助程序在服務器端進行了評估。您將需要使用javascript來操作生成的鏈接並將index
變量附加到href
。
難道這不是你自己的另一個問題嗎? http://stackoverflow.com/questions/3541918/asp-mvc-2-dynamic-href-by-javascript/3542047#3542047 – Peter 2010-09-03 10:40:58