You are right, i have this in my _layout
@{
SetAntiForgeryCookie();
}
How my mobile native app will know about this token ? How do i create the token in my mobile native app to send it to AppService or WebAPI Controller ?
yea there is
X-Requested-With:XMLHttpRequest X-XSRF-TOKEN: tokenvalue
so i doesn't need to put the @Html.AntiForgeryToken() in my AJAX View?
Damn,
i didn't know about this part!
Thanks a lot it work perfectly!
Hey,
Here is a project where i tested to upload a file and still, it doesn't work!
<a class="postlink" href="https://www.dropbox.com/s/zeyk4b6mq1wzdjv/TestUpload.rar?dl=0">https://www.dropbox.com/s/zeyk4b6mq1wzd ... d.rar?dl=0</a>
Here is what i've done to test!
-> Download Project Templace with MVC -> Update Nuget-Package -> Create ViewModel with HttpPostedFileWrapper Object -> Create Action to Receive ViewModel -> Create Form with File Input -> Test!
In the project, go to the "About" Page and try to send a file.
If you doesn't send a file, it doesn't trigger an error, but if u send a file it's triggering ValidationError.
Here is the error :
WARN 2016-09-23 15:22:10,690 [5 ] stUpload.Web.Controllers.AboutController - Method arguments are not valid! See ValidationErrors for details.
Abp.Runtime.Validation.AbpValidationException: 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)
thx to take time to fix this or point me out what's wrong! :)
Bump,
Did you test it ?
Because it seems to be a problem for other than me too...
<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1384">https://github.com/aspnetboilerplate/as ... ssues/1384</a>
the ignored type doesn't work in the MVC controller Validation
And we doesn't want to disable validation because the Framework is supposed to handle it properly
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:
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.
When putting this to On
i get "Error detail not sent by server."
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"
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!
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.
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