Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
How ASP.NET Core MVC Razor get inside the URL parameter, ASP.NET which the acquisition method invalid
Get inside the URL parameters are as follows in ASP.NET
-
@Html.ViewContext.RouteData.Values["id"]
-
@Request.RequestContext.RouteData.Values["id"]
-
@Html.ViewContext.RouteData.Route.GetRouteData(Html.ViewContext.HttpContext).Values["id"]
In ASP.NET Core which I tried first invalid, followed by self-testing
ASP.NET Core Inside acquisition URL parameters are as follows
@Context.Request.Query["Name"]
Original Address My blog address: Wy blog