Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "korigoth"

Hey,

i've read the documentation <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/XSRF-CSRF-Protection">http://www.aspnetboilerplate.com/Pages/ ... Protection</a> and i've check the section about WebAPI.

Does it refer to controller in the WebAPI project for the protection or the Services in the Application Layer are also protected by the AntiForgery ?

because i tried to use the abp.services.app.myservice.method(data) without any @Html.AntiForgeryToken() and it worked!

So i was not sure about if it was a normal behaviour?

Question

Hey,

I want to create a global filter that will push in the ViewBag a setting value of the user (is menu-collapsed)

How can i inject ISettingManager in my filter ?

Thx in advance

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)

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.

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

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({})
                })
            );

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?

Showing 1 to 7 of 7 entries