Possible Duplicate:
runtime loading of ValidateAntiForgeryToken Salt value
I have added the salt into config file but its throwing the following error. is there any way to use the Salf value from config file? I have tried to use Static
instead of const
but not working.
Error
constant initializer must be compile-time constant
Code
public const string SaltValue= ConfigurationManager.AppSettings["SaltValue"];
[HttpPost]
[ValidateAntiForgeryToken(Salt = SaltValue)]
public ActionResult Index(SomeViewModel someViewModel)
{
return View();
}
Many Thanks