我有这条路
在视图中
<img src="PhotoDisplay.ashx?photoid=12&size=medium" alt="Image with no resize"/>
我想将源 url 路由到一个 action 。我必须使用这种 url 格式,因为我正在重建一个站点。所以我也想让所有链接在新站点中保持活跃。在 global.asax 我添加了如下所示的溃败
routes.MapRoute(
"PhotoDisplay", "PhotoDisplay.ashx?photoid={photoID}&size={size}",
new { controller = "Images", action = "PhotoDisplay", photoid= "",size="" }
);
但它在编译时给出错误。我怎样才能映射那种 url 的路由