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)
...
精彩评论