How ASP.NET Core MVC Razor get inside the URL parameter

Original: How ASP.NET Core MVC Razor get inside the URL parameter

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.
This link: https://blog.csdn.net/qq_38613453/article/details/103074884
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
  1. @Html.ViewContext.RouteData.Values["id"]

  2. @Request.RequestContext.RouteData.Values["id"]

  3. @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

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/11913769.html