Open Closed

set the TargetUrl of Ajaxresponse #4950


0
jollyticket created

Is there a way to set the "targetUrl" value from an ApplicationService? I want use this property to redirect the user under a particular condition. Im'm using the asp.netcore/angular template.

thanks


2 Answer(s)
  • 0
    ivanosw1 created

    Hi, I've the same need: populate targerUrl field in a UserFriendlyException. There is a way to achieve that?

    Thank you

    Abp 9.3.0 Core + Angular

  • 0
    ismcagdas created
    Support Team

    Hi,

    To do this, you can add DontWrapResult attribute to your method and wrap your result in https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Common/Web/Models/AjaxResponse.cs manually.

    But, I think instead of doing that, adding a targetUrl to your response and handling it on the UI will be much easier.