getting the id value of current url in asp.net mvc 2.0
i am using a actionlink in master page of user module.i want to pass the eventid of the current url(in all views) to the actionlink as a route value.But i use the following code,
<%=Html.ActionLink("Create Account", "UserRegistration",
new { eventid = ViewContext.RouteData.Values["id"] })%>
But it doesnot retrieve the id fom the url.
my url is in following formate,
htt开发者_如何学JAVAp://localhost:12905/User/User/Order?eventID=2
here eventID=2 is common for all views.So i want to send this eventID to the actionlink as route value. Thanks in advance,
Shouldn't that be "eventId" instead of "id" in the ActionLink:
<%= Html.ActionLink(... ViewContext.RouteData.Values["eventId"] })%>
精彩评论