Solved

Does not work in root folder, but works in subfolder

Posted on 2011-03-15
5
1,267 Views
Last Modified: 2012-05-11
Hi,
Initially I put my application in /wwwroot/KLIS folder, worked normally (also from visual studio)
Then decided to move all files into root folder, that is, to wwwroot folder.
And now when I try to access ~/SALES/chart.aspx - it redirects to login page.
I have Windows 7 with Framework 4.0 installed.
I use Microsoft membership, and Telerik chart.

What may be the problem ?

Here is my web.config file (I think that problem is not here, anyway)



<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
    </pages>
    <customErrors mode="RemoteOnly" defaultRedirect="ErrRequest.aspx" />

  </system.web>
  <appSettings>
    <add key="KLIS" value="KLIS" />
    <add key="ChartImageHandler" value="storage=file;timeout=20;" />
  </appSettings>
  <connectionStrings>
    
  </connectionStrings>
  <system.net>
    <mailSettings>
      
    </mailSettings>
  </system.net>
  <location path="CaptchaImage.axd">
    <system.web>
      <authorization>
        <allow roles="*" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Default.aspx">
    <system.web>
      <authorization>
        <deny roles="Accountant" />
        <allow users="*" />
        <deny users="?" />
      </authorization>
    </system.web>
  </location>
  <location path="auth">
    <system.web>
      <authorization>
        <allow roles="Admin,User" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="admin">
    <system.web>
      <authorization>
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Reports">
    <system.web>
      <authorization>
        <allow roles="Report" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="SALES">
    <system.web>
      <authorization>
        <allow roles="SDB" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <system.web>
  
    <trace pageOutput="true" />
    <compilation targetFramework="4.0" debug="true">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms name=".MyAppAuth" loginUrl="/Auth/Login.aspx" defaultUrl="auth.aspx" timeout="280" cookieless="UseCookies" />
    </authentication>
    <authorization>
      <allow users="*" />
    </authorization>
    <httpHandlers>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="CaptchaImage.axd" verb="GET" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
    </httpHandlers>
    <membership defaultProvider="AspNetSqlMembershipProvider">
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="KLISConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordFormat="Hashed" applicationName="/KLIS" />
      </providers>
    </membership>
    <roleManager enabled="true" cacheRolesInCookie="true">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="KLISConnectionString" applicationName="/KLIS" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/KLIS" />
      </providers>
    </roleManager>
    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="KLISConnectionString" applicationName="/KLIS" />
      </providers>
    </profile>
    <healthMonitoring heartbeatInterval="0" enabled="true">
      <bufferModes />
      <profiles />
      <eventMappings>
        <clear />
        <add name="All Errors" type="System.Web.Management.WebBaseErrorEvent" startEventCode="0" endEventCode="2147483647" />
      </eventMappings>
      <providers>
        <clear />
        <add connectionStringName="KLISConnectionString" maxEventDetailsLength="1073741823" buffer="false" name="SqlWebEventProvider" type="System.Web.Management.SqlWebEventProvider" />
        <add type="System.Web.Management.SimpleMailWebEventProvider" name="EmailWebEventProvider" buffer="false" from="zaiitov@gmail.com" to="zaiitov@gmail.com" subjectPrefix="Book Reviews Runtime Error: " />
      </providers>
      <rules>
        <clear />
        <add name="All Errors Default" eventName="All Errors" provider="SqlWebEventProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
        <add name="All Errors To E-Mail" eventName="All Errors" provider="EmailWebEventProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
        <add name="All Errors To Database" eventName="All Errors" provider="SqlWebEventProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
      </rules>
    </healthMonitoring>
    <siteMap enabled="true">
      <providers>
        <clear />
        <add name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true" />
        <add name="anonProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="WebAnon.sitemap" securityTrimmingEnabled="true" />
      </providers>
    </siteMap>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <remove name="MSCaptcha" />
      <remove name="ChartImageHandler" />
      <add name="MSCaptcha" path="CaptchaImage.axd" verb="GET" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ChartImage_axd" verb="*" preCondition="integratedMode" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" />
    </handlers>
  </system.webServer>
</configuration>

Open in new window

0
Comment
Question by:exceter
  • 3
5 Comments
 
LVL 8

Accepted Solution

by:
tiagosalgado earned 500 total points
ID: 35136851
Have you make that changes too in IIS?
0
 
LVL 11

Expert Comment

by:azarc3
ID: 35137002
Are you in the Accountant role? At a glance it looks like that role is denied access to the root of the site.
0
 
LVL 3

Author Comment

by:exceter
ID: 35144139
tiagosalgado
What changes should I make? The Virtual folder (where it works fine) as soon as root folder have the same Application pool.

azarc3
I am in SDB role. Accountant role works fine in its appropriate folder.
0
 
LVL 3

Author Comment

by:exceter
ID: 35144395
Well, I found the problem.
Initially I created a virtual folder and put files there, it works fine.
Then I needed to move files to root folder, and faced that problem. I forgot to remove that virtual folder (I did not think it will make any problem), and that was ther problem. I removed it, and it works fine.

In web.config I tried to put <clear /> and <remove name= /> of course. It is strange that it does not worked.
0
 
LVL 3

Author Closing Comment

by:exceter
ID: 35144810
Thak you for help
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquey and footrable 2 34
VB.net/WinForms: adjust Screen Resolution 6 40
Problem to error 4 43
Displaying a web form as a modal popup dialog box. 4 17
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now