Reputation: 1264
Hi I'm creating a small site with MVC, I've got about three pages, I'm trying to allow access for all users on a certain page. The page is created in my "HomeController index".
<system.web>
<authentication mode="Forms">
<forms defaultUrl="~/" loginUrl="~/Account/Login" name="Test" timeout="10080">
</forms>
</authentication>
</system.web>
</system.web>
<location path="Home">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<system.webServer>
This is my web config but it still redirects me when i try to go on /home
Upvotes: 1
Views: 286
Reputation: 38529
Add the [AllowAnonymous]
attribute above your controller action.
public class HomeController : Controller
{
[AllowAnonymous]
public ActionResult Index()
{
}
}
Upvotes: 1