I am new to C # and the asp.net world. So the question I'm going to ask can be rather lame, I hope that you will carry everything with me :). Ok, so I read the book and understood how authentication and authorization in asp.net happens.
Now I have defined my authentication and authorization as follows in my web.config;
<authentication mode="Forms"> <forms loginUrl="~/Home/LogOn" protection="All" path="/" timeout="30" name="MyCookies" /> </authentication> <authorization> <deny users="?"/> <allow users="*"/> </authorization>
and then I started to create my registration form. Which looks like this:
<form method="post" action="../Home/LogUser"> <fieldset> <legend>Log On</legend> <p>User Name</p> <p><input type="text" name="txtUserName" id="txtUserName" size="30"/></p> <p>Password</p> <p><input type="password" name="txtPassword" id="txtPassword" size="30"/></p> <p><input type="submit" name="btnSubmit" value="Log On"/></p> </fieldset> </form>
My problem is that since I decided to reject anonymous users in my web.config, when I try to submit my form, which directs the controller, it returns to the login page. How can I handle this situation? perhaps I understood the whole journal paradigm in asp.net, in which case I humbly appreciate the explanation in this regard.
source share