2010-02-01 51 views

回答

4

你將需要建立一個自定義的RouteValueDictionary變量傳遞給Html.ActionLink。試試這樣的:

<% 
    var rvd = new RouteValueDictionary(ViewContext.RouteData.Values); 
    foreach (string key in Request.QueryString.Keys) 
    { 
     rvd[key]=Request.QueryString[key]; 
    } 
    rvd["MyParam"] = "WhateverValue"; 
    Response.Write(Html.ActionLink("Link Text", "Action", rvd)); 
%> 
相關問題