【发布时间】:2019-12-29 18:29:12
【问题描述】:
在 Web 应用程序中,我创建了一个 Page:DetailPage
public void OnGet(int id)
{
var bll = new BLL.Articles();
Item = bll.GetModel(id);
if (Item == null)
{
RedirectToPage("Blogs");
}
}
网址是
localhost/Detail?id=1
我可以将其设为 Web API URL,例如 `
localhost/Detail/1
我添加了[HttpGet("id")],但没有按预期工作。
【问题讨论】:
-
@Nkosi 谢谢我添加它 options.Conventions.AddPageRoute("/Contact", "TheContactPage/{text?}.html");对吗?
-
@Nkosi 我找不到 Model.RouteDataTextTemplateValue 页面不包含它
标签: .net asp.net-core asp.net-core-2.0 razor-pages