开发者

Post an a href value to controller in asp.net mvc

I want to send the id value of tag to controller when user click on any link.

TempString1.Append("<li><a id="+aa[i].int_FeatureId+" href=../" + aa[i].Feature.vcr_LinkName + ">" + aa[i].Feature.vcr_FeaturesName + "&开发者_开发知识库lt;/a></li>");


In ASP.NET MVC you usually use Html.ActionLink or the like.

But to stay in your line, how about:

href=../" + aa[i].Feature.vcr_LinkName + "&featureId=" + aa[i].int_FeatureId + "

and in your controller:

public ActionResult ActionName(string id, int featureId)
...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜