Search code examples
asp.netauthenticationweb-configportalintranet

Web.config and ASP.NET configuration issue


New to Microsoft Web Developer 2010 Express, and not an accomplished programmer, but I can get by ... usually. I did make a company website with MWD 2010 and things are going great.

I'm trying to make a company portal. I tried using the ~/Account folder that comes with new asp.net websites, but I wanted to try one from scratch on my own. So I followed Microsoft's instructions and created one on my own in another folder called ~/Portal. --> msdn.microsoft.com/en-us/library/879kf95c(v=vs.80).aspx

I don't know if I made a programming mistake, or if it's with my ASP.NET Configuration, or what I think it is, my web.config file, but something happened. The 2 folders are crossing up. Like, I'll be in welcome.aspx on the ~/Portal/welcome.aspx, and it'll redirect me to the ~/Account/login.aspx page. I made a change in the ROOT web.config file (not my Portal or Account folder): Was:

forms loginUrl="~/Account/login.aspx" timeout="2880"

Changed to:

forms loginUrl="~/Extranet/welcome.aspx" timeout="2880"

But when I click the login link on Extranet/welcome.aspx, it still redirects me to Account/login.aspx. Specifically, the URL says:
(root)/Account/Login.aspx?ReturnUrl=%2fExtranet%2fwelcome.aspx

Now, it will allow me to go to the ~/Portal/welcome.aspx page, but when I click the login link, it takes me to the ~/Account/login.aspx page. Strange.

My question is: (a) Is this something that's easily fixable? (b) Should I delete both folders and start from scratch? Not a problem, but I don't want to screw anything up. If I do this, will I have to make redactions to the root web.config file? (c) Is there another solution I should be using instead of following Microsoft's instructions?

There's a web.config in my root, which appears to be the one being edited by changes I make in ASP.NET Configuration, and there's one in my ~/Account folder, where the login.aspx that comes with new websites is.

Thanks for taking the time to read this, if you made it this far, and thank you for any and all help you can offer!


Solution

  • Here is the article for the solution:

    Here is the given solution (add this to the <appSettings> section in your web.config):

    <add key="autoFormsAuthentication" value="false" />