MVC3 compilation fix
authorMarek Habersack <grendel@twistedcode.net>
Mon, 16 Apr 2012 14:28:48 +0000 (16:28 +0200)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 16 Apr 2012 14:28:48 +0000 (16:28 +0200)
mcs/class/System.Web.Mvc3/Mvc/HtmlHelper.cs
mcs/class/System.Web.Mvc3/Mvc/ValidateAntiForgeryTokenAttribute.cs

index 63e62186576c0570d2442f675dd740a9d470fc75..a3b0726e40eb4790ee29a1f388d2b9bcee080a83 100644 (file)
         }
 
         public MvcHtmlString AntiForgeryToken(string salt, string domain, string path) {
-            return new MvcHtmlString(AntiForgery.GetHtml(ViewContext.HttpContext, salt, domain, path).ToString());
+            //Disabled to compile MVC3 with the newer System.Web.WebPages helpers
+            //return new MvcHtmlString(AntiForgery.GetHtml(ViewContext.HttpContext, salt, domain, path).ToString());
+            return new MvcHtmlString(AntiForgery.GetHtml().ToString());
         }
 
         [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "For consistency, all helpers are instance methods.")]
index 4bd787478f1eddc026ae2d3290b0af21c50a7302..f6cbf95f9438fe04d8983979e3e0d2301660349b 100644 (file)
@@ -18,7 +18,7 @@
             }
         }
 
-        internal Action<HttpContextBase, string> ValidateAction {
+        internal Action ValidateAction {
             get;
             private set;
         }
@@ -27,7 +27,8 @@
             : this(AntiForgery.Validate) {
         }
 
-        internal ValidateAntiForgeryTokenAttribute(Action<HttpContextBase,string> validateAction) {
+       //Modified to compile MVC3 with the newer System.Web.WebPages helpers
+        internal ValidateAntiForgeryTokenAttribute(Action validateAction) {
             Debug.Assert(validateAction != null);
             ValidateAction = validateAction;
         }
@@ -37,7 +38,8 @@
                 throw new ArgumentNullException("filterContext");
             }
 
-            ValidateAction(filterContext.HttpContext, Salt);
+           //Modified to compile MVC3 with the newer System.Web.WebPages helpers
+            ValidateAction();
         }
     }
 }