コード例 #1
0
        public static void Validate()
        {
            if (HttpContext.Current == null)
            {
                throw new ArgumentException(CustomAntiForgeryResources.HttpContextUnavailable);
            }
            string salt = null;

            CustomAntiForgery.Validate(new HttpContextWrapper(HttpContext.Current), salt);
        }
コード例 #2
0
        public static HtmlString GetHtml()
        {
            if (HttpContext.Current == null)
            {
                throw new ArgumentException(CustomAntiForgeryResources.HttpContextUnavailable);
            }
            string salt   = null;
            string domain = null;
            string path   = null;

            return(CustomAntiForgery.GetHtml(new HttpContextWrapper(HttpContext.Current), salt, domain, path));
        }