Base solution for your next web application

Activities of "korigoth"

Hey,

I didn't know how to do SEO with SPA so I'm migrating the website that I've made with ABP SPA to ABP MPA. If anyone did SEO with ABP SPA, I 'd be sincerely grateful for some help! ;)

But here is the question for the ApplicationService. Like I said it was a SPA website, so all my logic is in ApplicationServices.

Can I use Application layer like I was using it with AJAX request? Because i think that all the filters that are configured will be useless by directly calling the application service if i'm not mistaken?

I will need IPermissionChecker and IAbpSession and implement my logic in each controller action ? Or do I lack knowledge about ABP and MVC Controller?

thx!

EDIT: Apparently, the AbpAuthorize filter is called when I Injected the IMyService in MVC Controller then using it in my childaction. How can it be called if I directly use the method and it's not called by ABP?

like _myService.Execute() in MVC is firing the AbpAuthorize! am I right?

Hey,

I have a simple action that i removed all code except the RedirectToAction method and it's provoking an error each time i call it.

Can i know what i'm doing wrong ?

Error: An error has occured! Error detail not send by server. I have no log registred and AbpHandledExceptionData doesn't get fired.

[HttpPost]
        [AbpMvcAuthorize]
        public ActionResult CreateModel(CreateModelViewModel model)
        {
                return RedirectToAction("CreateModel");
        }

        [HttpGet]
        [AbpMvcAuthorize]
        public ActionResult CreateModel()
        {
            var model = AsyncHelper.RunSync(() => _modelService.GetModel());

            return View(model);
        }


js file

            abp.ui.setBusy(
                $('#ModelPanel'),
                abp.ajax({
                    url: abp.appPath + 'Model/CreateModel',
                    type: 'POST',
                    data: JSON.stringify({})
                })
            );
Question

Hey,

Can i know what is the use case for the Validation in MVC to hit before we even get in the controller? (version 10.0.1)

I cannot understand the use case or i cannot see how it should be used ? Is there a place where the error are logged ? Or is there a place where we can get them?

Thx

bump, still trying to figure out, what is the use case for the validation to hit before the controller.

Because it cause dead code for MPA in template and it's not userfriendly (cannot use ValidationSummary anymore), so it could be cool if we can get the reason behind the feature and how it is suppose to be used!

thx

By the way the DeadCode with this validation is in ControllerBase -> CheckModelState is now useless for MPA

The error was not logged in the log.txt file.

But it was a noob mistake.... doing ajax call and returning View() was my error. When i switched to PartialView or JsonResult it worked again.

Hey,

Can i get some help to understand why do i get this default error each time that I throw a UserFriendlyExceptionException in an MVC Controller with abp.ajax method.

i did a simple code to show the problem! (version 0.10.0.1)

public async Task<JsonResult> TestMethod()
{
            throw new UserFriendlyException("Test1", "Test2");
}

abp.ui.setBusy(
  $('#paneltest'),
  abp.ajax({
    url: abp.appPath + 'Home/TestMethod',
    type: 'POST',
    data: JSON.stringify({}),
    error: function (error, jqXHR) {
      console.log(error);
      console.log(jqXHR);
    }
  })
);

image to show the result of the Error in Browser : <a class="postlink" href="https://postimg.org/image/45edyyagl/">https://postimg.org/image/45edyyagl/</a>

sorry i didn't find a way to upload it here :(

So is there anything i'm doing wrong ?

EDIT:

I updated the project to 0.10.3.1 and the same problem happen.

Ok, thx a lot for your answer and time :)

It will help to explain this to other while trying to convert them to ASP.Net Boilerplate!

When putting this to On

i get "Error detail not sent by server."

What am i missing ?

Edit :

Ok i got it working... sorry i was using ActionResult as return type thx for the link to the doc! :)

Is it a normal behaviour to return the real code in the abp.jquery.js -> handleResponse method

data.error.responseText <- this property show my controller code like if it was the customError="Off"

Hey,

I have the same problem with the ABP Template, so i get it in my log while dev.

The way I resolved this problem:

  • Remove the Toastr Nuget. (Because we doesnt get the sourcemap file)
  • Go on GitHub : <a class="postlink" href="https://github.com/CodeSeven/toastr">https://github.com/CodeSeven/toastr</a>
  • Download the code and put the new CSS, JS file to their place.

PROS/CONS ++ Now you updated Toastr to 2.1.3 instead of 2.1.1 and you have your source file -- You lost track of your dependency in Nuget Management but it's a library that doesn't evolve anymore (or at least it's rarely updated with new features)

You can disable it in google chrome as Ismcagdas said if you doesn't care to be able to debug this library.

Hey,

I've updated my project to V0.12.0.2, because i've seen that you added the Ignore type to the AbpWebModule

I'm in MVC Project, so i checked the dependency,

ProjectWebModule -> AbpWebMvcModule -> AbpWebModule dependency.

AbpWebModule is calling AddIgnoredTypes to the Validation Ignore type but i still get the validation errors on the V0.12.0.2 while trying to post file to my MVC controller!

I use 'HttpPostedFileWrapper' object that it is in the Ignore List added by AddIgnoredTypes.

If I doesn't post a file, it work perfectly, but if I post a file, I get this error :

Method arguments are not valid! See ValidationErrors for details.

   at Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:line 89
   at Abp.Web.Mvc.Validation.AbpMvcValidationFilter.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Validation\AbpMvcValidationFilter.cs:line 35
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Showing 1 to 10 of 17 entries