Asp.Net Core 我遇到 404 错误问题 [英] Asp.Net Core I'm getting 404 error problem

查看:43
本文介绍了Asp.Net Core 我遇到 404 错误问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到 404 错误,但当我刷新页面时问题解决了.

I'm getting a 404 error but the problem is solved when I refresh the page.

此 URL 正在被服务调用.在这种情况下,它总是会出错.如果我刷新页面,问题就会好转.页面打开.

This url is being called by a service. In this case it always gets error. If I refresh the page the problem is getting better. The page opens.

问题出在哪里?你能帮我吗?

Where is the problem? Can you help me?

我的回调参数:

CallbackUrl = $"{httpContext.Request.Scheme}://{httpContext.Request.Host}{httpContext.Request.PathBase}/company/payment/callbackpayments/?data=" + model.Transaction.Id.ToString()

IActionResult:

IActionResult:

[HttpGet]
[AllowAnonymous]
public IActionResult CallbackPayments(string data)
{
   return RedirectToAction("Index","Dashboard",new { area="Company"});
}

推荐答案

尝试改变

[HttpGet]

为此:

[HttpGet("company/payment/callbackpayments/?data={data}")]

或确保您的控制器在路由属性中具有 /company/payment[Route("company/payment")]

or make sure your controller has /company/payment in a route attribute [Route("company/payment")]

这篇关于Asp.Net Core 我遇到 404 错误问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆