简体   繁体   English

Asp.Net Core我遇到404错误问题

[英]Asp.Net Core I'm getting 404 error problem

I'm getting a 404 error but the problem is solved when I refresh the page. 我收到404错误,但刷新页面后问题已解决。

This url is being called by a service. 服务正在调用此URL。 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? 你能帮助我吗?

My Callback Parameter: 我的回调参数:

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"});
}

try changing 尝试改变

[HttpGet]

to this: 对此:

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

or make sure your controller has /company/payment in a route attribute [Route("company/payment")] 或确保您的控制器的路径属性[Route("company/payment")]具有/company/payment

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在 ASP.NET Core Web API 应用程序上配置 CORS 时出现 CORS 错误 - I'm getting CORS error with CORS configured on ASP.NET Core Web API app 当我在 asp.net core 3.1 中工作时收到此错误值不能为空。 (参数'connectionString') - While I'm working ins asp.net core 3.1 getting this error Value cannot be null. (Parameter 'connectionString') 在ASP.NET Core 2中提交表单,并收到错误消息“正在发送数据状态代码:404; 未找到” - Submitting a form in ASP.NET Core 2 and getting an error “Sending Data Status Code: 404; Not Found” 将 asp.net core web api 部署到 aws elastic beanstalk 时出现错误 404 Not Found - Getting Error 404 Not Found when deployed asp.net core web api to aws elastic beanstalk Postman 为简单的 ASP.NET Core Web API 收到 404 错误 - Postman getting 404 error for simple ASP.NET Core Web API 在IRouter实现ASP.NET Core MVC上获取404 - Getting 404 on IRouter implementation ASP.NET Core MVC IIS中的ASP.NET Core + Framework获取HTTP 404 - ASP.NET Core + Framework in IIS getting HTTP 404 为什么我在 Asp.Net CORE 中使用 JWT 获得 401 未经授权的工作? - Why I'm getting a 401 unauthorized working with JWT in Asp.Net CORE? 如何修复 IIS 上的 ASP.Net Core 404 错误? - How to fix ASP.Net Core 404 error on IIS? ASP.NET Core - 处理404和500错误 - ASP.NET Core - handling 404 and 500 error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM