I am new in MVC. I want to restrict my img folder role wise but:
I don't know how to create custom role. So please guide me on how I mange Custom Role Management?
web.config
<location path="img" allowOverride="false">
<system.web>
<authorization lockItem="true">
<allow roles="member"/>
<deny users="*" />
</authorization>
</system.web>
</location>
I have provided above code in web.config file.
<authentication mode="Forms">
<forms name="SiteUser" path="~" loginUrl="~/Login/Login" protection="All" timeout="30"/>
</authentication>
When I try in URL location http://localhost:51116/img it automatically redirects me on login page but when I write http://localhost:51116/img/1-1.png at that time I can access my file.
I want to restrict that folder and file inside that folder role wise.
Please help me.