Как добавить эту @ Html .AntiForgeryToken () на страницу html. невозможно отправить токен контроллеру - PullRequest
0 голосов
/ 13 апреля 2020

Пока что я попробовал приведенный ниже код, и если я нажму на кнопку, появится следующая ошибка:

The anti-forgery token could not be decrypted. 
If this application is hosted by a Web Farm or cluster, ensure that all machines 
  are running the same version of ASP.NET Web Pages and that the machineKey
  configuration specifies explicit encryption and validation keys. 
AutoGenerate cannot be used in a cluster.

Примечание: я пробовал это только на странице html, а не на cs html страница ...

html код:

<form action="/Account/LogOff" method="post" id="logoutForm" >
   <input type='hidden' name='__RequestVerificationToken' value='...' />
</form>

<li class="m-l-md"> 
 <a href="javascript:document.getElementById('logoutForm').submit()">
   <i class="fa fa-power-off"></i>
  </a>
</li>

Может кто-нибудь предложить решение Спасибо заранее ...

...