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>
Loading
Ashish DoshiPosted Jul 18, 2011, 1:03 AM
Going through your post, it seems that the Forms Authentication related code, as you may have written in the Login Page, is not complete or the same is not generating the Forms Authentication related cookies and authentication IDs (am not sure as the code for login activity is not provided).
Please go through the following post by Microsoft for implementing the same.
http://support.microsoft.com/kb/301240/EN-US
Hope it works.