I am trying to assign the encrypted value into session storage in .cshtml file.(我正在尝试将加密的值分配给.cshtml文件中的会话存储。)
but I couldn't.(但我做不到) I am getting a different error each time.(我每次都会收到一个不同的错误。) Error I got: Uncaught SyntaxError: Unexpected token ')' , Uncaught SyntaxError: Invalid left-hand side in assignment(我收到的错误: 未捕获的SyntaxError:意外的令牌')' , 未捕获的SyntaxError:分配中的左侧无效)<script type="text/javascript">
@{
string createApplicationRequestPKey =Request.QueryString["cpk"];
if(createApplicationRequestPKey != null)
{
@:sessionStorage.setItem('CreateApplicationRequestPKey', @createApplicationRequestPKey);
@:location.href = '/';
}
}</script>
Sample request :url?cpk=U2FsdGVkX1+S3rsDcNeHuP5g6LokgGx9/xV1QcSVR+g=(样本请求:url?cpk = U2FsdGVkX1 + S3rsDcNeHuP5g6LokgGx9 / xV1QcSVR + g =)
ask by Arun Kumar translate from so