我在 ajax 调用的回调中有以下代码:
jQuery.each(res, function ()
{
var anchor = $("<a/>", { id: this.UrlTitle, text: this.Name.toLowerCase(), style: 'color:#000000;' });
anchor.attr('href', @(Url.RouteUrl("Detail",new{indicator=this.Name,urltitle=this.NameUrl}));");
});
我想在 foreach 中使用 this.Name 和 this.UrlTitle。
问题是我想避免使用查询字符串变量(?param = 1等......)
你知道如何将 jquery 变量注入到 html helper Url.RouteUrl 中吗?
提前致谢
问候。
何塞。