Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
Hello everyone,
I m working on Asp.net 4.0 c#

I am facing issue with redirecting on home page.
What exactly happening
I am creating a new site with the functionality
- form authentication
- custom role provider
- site map (from web.sitemap)
The site is build and debug properly.
And my requirement is when any one visit to site he should able to see the home.aspx (home page of Site)but
when i am running the site it's redirecting to login.aspx(login page of site) and my URL becomes as
"http://localhost:1552/aspx/Login.aspx?ReturnUrl=%2faspx%2fHome.aspx"
 
Also the master page is not applying with its CSS, only the content of master page is displaying.
 
Web.config file changes for form authentication are
<authentication mode="Forms">
    <forms defaultUrl="~/aspx/Home.aspx"  loginUrl="~/aspx/Login.aspx"  timeout="60"/>
  </authentication>
 
# For sitemap, Web.config changes are
<siteMap defaultProvider="AspNetXmlSiteMapProvider" enabled="true">
      <providers>
        <clear />
        <add name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
     siteMapFile="web.sitemap" securityTrimmingEnabled="true"  />
      </providers>
    </siteMap>
 
    <authorization>
      <deny users="?" />
    </authorization>
 
And for authentication i have 2 type of user 1. from admin and another one guest
for there aspx page i have separately create the folder structure and in web.config i provide there location as
 <location path="aspx/_admin">
    <system.web>
      <authorization>
        <allow roles ="admin"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path ="aspx/_guest" >
    <system.web>
      <authorization>
        <allow roles="guest" />
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
 
I think the issue is related to form authentication or may be due to the location tag which i have specified in web.config file
Its a urgent requirement, the dead-line is too short. please help me if any one knows the solution
Posted 21-Sep-12 16:26pm
sagar55910
Comments
Tadit Dash at 21-Sep-12 22:58pm
   

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Also add a section in web.config.
 
 <location path="~/Home.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 350
1 Gihan Liyanage 332
2 OriginalGriff 236
3 ClimerChinna 222
4 vikinghunter 168
0 Sergey Alexandrovich Kryukov 8,298
1 OriginalGriff 7,112
2 CPallini 2,598
3 Richard MacCutchan 2,005
4 Abhinav S 1,788


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100