我需要为确认电子邮件创建回调URL。我使用以下代码创建回调URL,但它返回null:
string token="111";
string email="email";
var callbackUrl = Url.Action("confirm-email", "account", new { token, email =
email }, Request.Scheme);发布于 2021-03-20 00:01:02
您是否在不指定任何路由的情况下调用app.UseMvc()?正如here所解释的,这可能会导致Url.Action返回null。
如果是这样的话,您应该尝试通过以下方式调用app.UseMvc():
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}");
});https://stackoverflow.com/questions/66710674
复制相似问题