When I add Microsoft.AspNetCore.Mvc in ApplicationService solution and use RedirectAction, it causes server error. I also tried installing AbpAspNetCore package but still no luck.
Is there any other way to perform a redirect?
6 Answer(s)
-
0
Please show:
your code, and
the error log. Can you also find out whether the error occurs when you:
create a RedirectAction, or
return it? You can do this by assigning it to a variable and setting a breakpoint before you return it.
If it's Case 1, you can create and inject IRedirectionDelegate interface in Application project. Then implement and register that in Web.Mvc project where the action (and controller) exists.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @aaron,
This is in continuation to #3984. All the problems go away after I removed Microsoft.AspNetCore.Mvc from ApplicationService. But I'm still stuck with Redirect.
I believe creating IRedirectionDelegate could solve my problem. Can you share a sample for that? :)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Ah, you said RedirectAction in this post, but you're getting the url string from _shopifyManager in that post. Since you're not redirecting to a controller action, that suggestion may not be relevant in solving your issue.
Please avoid creating multiple posts for the same issue. Update the same post so that we can all further understand. Not receiving replies does not mean we're ignoring it. There isn't enough information to reproduce it and offer a solution.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @aaron,
For the previous post, the issue was resolved by removing Microsoft.AspNetCore.Mvc. I thought it would be better to create a new post as it is a simple clear thing. Earlier post was a mess. Apologies for that.
I am facing this issue.
public async Task GetShopifyInstall(string shop) { var redirectUrl = _shopifyManager.GetAuthRedirectUrl(shop); //********** How to redirect here?********** }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
How are you currently calling this method from client side?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @ajayak,
As far as I know, you cannot return RedirectAction to angular, you must return JsonResult.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)