Eddie Jack

Eddie Jack

  • NA
  • 156
  • 138.7k

Restrict my page from unauthorized users

Jul 18 2011 12:12 AM
Hello...
I am tried to restrict unauthorized user on finance.aspx page. It is working but not what I expect. When I click on finance link it redirect to me on login page. But when I already logged in and I click on finance link again it automatically redirect to me on login page that I don't want. What should I do that when user is logged in then user can we finance page otherwise if user should redirect to login page.

Code:

<?xml version="1.0"?>
<
configuration>
  <
connectionStrings>
  <
add name="Employee_table" connectionString="Data Source=MCNDESKTOP10\SQLEXPRESS;Initial Catalog=MCN_Office;Integrated Security=True" providerName="System.Data.SqlClient" />
</
connectionStrings>
<
location path="Finance.aspx">
<system.web>
<
authorization>
<
deny users="?"/>
<allow users="*"/>
</authorization>
</
system.web>
</
location>
  <
system.web>
  <
authentication mode="Forms" />
  <
compilation debug="true" targetFramework="4.0"/>
  </
system.web>
</configuration>

Answers (1)