This question is locked. New answers and comments are not allowed.
Hi
I am ussing the Menu control.
I have an attribute called [IsPostedFromThisSite]
This attribute makes the Telerik menu not show the Index action at all. Any ideas how this can be fixed?
I am ussing the Menu control.
I have an attribute called [IsPostedFromThisSite]
Here is my attribute code[HttpGet] public ActionResult Index() { return View(); } [HttpPost] [ValidateAntiForgeryToken] [IsPostedFromThisSite] public ActionResult Index(LogOnModel model) { }
public class IsPostedFromThisSiteAttribute : AuthorizeAttribute { public override void OnAuthorization(AuthorizationContext filterContext) { if (filterContext.HttpContext != null) { if (filterContext.HttpContext.Request.UrlReferrer == null) throw new System.Web.HttpException("Invalid submission"); if (filterContext.HttpContext.Request.UrlReferrer.Host != GlobalSettings.SiteHost) throw new System.Web.HttpException("This form wasn't submitted from this site!"); } base.OnAuthorization(filterContext); } }
This attribute makes the Telerik menu not show the Index action at all. Any ideas how this can be fixed?