mardi 28 mars 2017

Redirect user to login if not logged in ASP.NET web form using C#

I'm trying to develop web app in ASP.NET web forms using C# and I've looked everywhere I could on the internet, but I found no solution to the problem. I've tried editing the default Web app template, to restrict a user from accessing any page if the user is not logged in. The default page should be the log in page and if the user clicks on anything else, he/she must be redirected to login page. Using MVC is easier, with just one bit of code on web.config but I've no idea what to do here in the web form

This is currently what my web.config contains.

<?xml version="1.0"?>
<configuration>

  <location path="Manage.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>

</configuration>

Where exactly I need to change?




Aucun commentaire:

Enregistrer un commentaire