简体   繁体   中英

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.

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?

My Callback Parameter:

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

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")]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM