Submit Product Review The required anti-forgery form field "__RequestVerificationToken" is not present.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
I get the
"The required anti-forgery form field "__RequestVerificationToken" is not present."
error when I try to submit review on any product.

Please let me know how to avoid it.
8 years ago
[email protected] wrote:
I get the
"The required anti-forgery form field "__RequestVerificationToken" is not present."
error when I try to submit review on any product.

Please let me know how to avoid it.



Which theme and nopcommerce version have used?
8 years ago
Write the following code in ProductReviews.cshtml into the form tag
 @Html.AntiForgeryToken()
8 years ago
Worked a charm - thanks!  I guess they missed it off the Bootstrap theme.
8 years ago
[email protected] wrote:
Worked a charm - thanks!  I guess they missed it off the Bootstrap theme.


Welcome. May be they missed during version update.
8 years ago
But, for me it does not work. I am using NopRoot theme and nopcommerce 3.70. Please help!!!
8 years ago
[email protected] wrote:
But, for me it does not work. I am using NopRoot theme and nopcommerce 3.70. Please help!!!


Where you faced the problem? In ProductRewiew page?
8 years ago
Please help me
i add this tag @Html.AntiForgeryToken() to ProductReviews.cshtml but not work
my theme is Default clean for version 3.7
when write subject, review, captcha and click on submit give error and i see this error in log

The required anti-forgery form field "__RequestVerificationToken" is not present.

System.Web.Mvc.HttpAntiForgeryException (0x80004005): The required anti-forgery form field "__RequestVerificationToken" is not present. at System.Web.Helpers.AntiXsrf.TokenValidator.ValidateTokens(HttpContextBase httpContext, IIdentity identity, AntiForgeryToken sessionToken, AntiForgeryToken fieldToken) at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.Validate(HttpContextBase httpContext) at System.Web.Helpers.AntiForgery.Validate() at System.Web.Mvc.ValidateAntiForgeryTokenAttribute.OnAuthorization(AuthorizationContext filterContext) at Nop.Web.Framework.Security.PublicAntiForgeryAttribute.OnAuthorization(AuthorizationContext filterContext) at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) 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)
8 years ago
kh_s wrote:
Please help me
i add this tag @Html.AntiForgeryToken() to ProductReviews.cshtml but not work
my theme is Default clean for version 3.7
when write subject, review, captcha and click on submit give error and i see this error in log


DefaultClean should work without your any modification.

Did you put it in inner form?

Like bellow==>  @Html.AntiForgeryToken() keep in the form tag


@using (Html.BeginForm())
                {
                    @Html.AntiForgeryToken()
8 years ago
i change to this but give error again :(
@model ProductReviewsModel
@using Nop.Web.Models.Catalog;
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken();
}
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title
    Html.AddTitleParts(Model.ProductName);
.
.
.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.