ASP.NET - some times url authentication is not working..  ASP.NET - some times url authentication is not working..

Asked By mani
12-May-11 06:39 AM
hi..i have specified url authentication for the following pages ..but its not wording some time..but some time works..
what will be the problem...
<authentication mode="Forms">

    <forms loginUrl="index.aspx">
    </forms>

    </authentication>

 <location path="Registration.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="PublicRegistration.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Public_view.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Public_listview.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Public_FullView.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Public_EditFullView.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="mastersubcaste.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin"/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="mastermothertongue.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Mastercaste.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="listview.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>

  <location path="changepassword.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Admin_view.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "/>
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Admin_FullView.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <!--<location path="FullView.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>-->
  <location path="website_FullView.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Website_changepassword.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Website_Editlistview.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  <location path="Website_view.aspx">
    <system.web>
    <authorization>
      <allow roles=" admin "   />
      <deny users="?"/>
    </authorization>
    </system.web>
  </location>
  Venkat K replied to mani
12-May-11 06:42 AM
May be you are not getting the right Userrole or Username in to your session or class objects and unble to verify the user or role against the config setting you mentioned.

Thanks
  dipa ahuja replied to mani
12-May-11 07:10 AM
Its giving this problem on every url or for some urls only?
  mani replied to dipa ahuja
12-May-11 07:48 AM
for all url which are specified here...
  dipa ahuja replied to mani
12-May-11 07:56 AM
try this way if it give you result:

<location path="mastersubcaste.aspx">
    <system.web>
    <authorization>
      <deny users="?" roles="user"/>
      <allow users="*" roles="admin"/>
    </authorization>
    </system.web>
  </location>
And i think for registration you should not set restriction.
Create New Account
help
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B How can we know a state of a thread? (A) What is use of Interlocked class ? (A) What is a monitor object? (A) What are wait handles? (A) What is ManualResetEvent and Webservices (B)What is an application domain? (B) What is .NET Remoting? (B) Which class does the remote object has to inherit? (I) what are two different types of remote A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET
application or web application to consume this service? It is True / False? FALSE How many classes can a single.NET DLL contain? Answer1: As many Answer2: One or more What are cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs. Example a. Static int var / / in c#.net b. static void in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging The control itself will take care of the date display How can you deploy an asp.net application ? You can deploy an ASP.NET Web application using any one of the
authentication modes and its implementation in projects hi, i am doing a project in asp.net. . i want to use a authentication mode in this project.it is a educational based, regarding some simple c, c++ programs find the details of persons who visits my site.so i want to do some authentication in this project. How To: Use Forms Authentication with SQL Server in ASP.NET 2.0 patterns & practices Developer Center J.D. Meier, Alex Mackman, Blaine Wastell, Prashant Bansode
Migration from ASP to ASP.net How to convert ASP site to ASP.NET site using C# http: / / www.asp.net / downloads / archived-v11 / migration-assistants / asp-to-aspnet hi, ASP.NET framework is very much different from unstrucured ASP and there is no correct way to
Tracing in ASP.NET? hi all, what is tracing? how to achieve tracing in asp.net? different ways of doing tracing? thanks and regards Aman Khan hi. . Tracing in ASP.NET 2.0 Tracing is a way to monitor the execution of your ASP.NET application. You can record exception details and program flow in a way that doesn't