My websit works fine on frame work version 3.5 but when i change to 4.0 every thing works fine except when i click on login , it does not take me to login page. instead gives error
Server Error in '/UsedCar' Application.
The resource cannot be found.
Description:
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /UsedCar/Account/Login
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
usedcar
Member
2 Points
4 Posts
Login Url on framework 4.0 not working
Mar 28, 2012 12:51 AM|LINK
My websit works fine on frame work version 3.5 but when i change to 4.0 every thing works fine except when i click on login , it does not take me to login page. instead gives error
Server Error in '/UsedCar' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /UsedCar/Account/Login
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
My config file has this
<authentication mode="Forms">
<forms loginUrl="login/usedcarlogin.aspx" defaultUrl ="used_cars.aspx" timeout="20" slidingExpiration="true" cookieless="AutoDetect" protection="All" requireSSL="false" enableCrossAppRedirects="false" path ="/" />
Now this error comes only in 4.0 version not in 3.5
I would appreciate all the help i can get.
Thanks
Ken
robwscott
Star
8079 Points
1491 Posts
Re: Login Url on framework 4.0 not working
Mar 28, 2012 01:54 AM|LINK
i see that you say "everything works in 4.0 except the login".
couple of questions
1) have your registered .net 4 framework on the machine that this is running on?
command prompt: C:\Windows\Microsoft.NET\Framework\v4.0.30319 --> aspnet_regiis.exe
2) have you configured IIS properly on the machine that this is running on?
3) is "login/usedcarlogin.aspx" (logon folder) actually in the root?
what gets me is this:
Requested URL: /UsedCar/Account/Login
and your web.config
<forms loginUrl="login/usedcarlogin.aspx"
perhaps use
<forms loginUrl="~/login/usedcarlogin.aspx"
and
defaultUrl ="~/used_cars.aspx"
Mark Answered if it helps - Good luck!
Cheers!
Design And Align
- Rob
usedcar
Member
2 Points
4 Posts
Re: Login Url on framework 4.0 not working
Mar 28, 2012 02:01 AM|LINK
Thank for the reply , I did run aspnet_regiis.exe and configured IIS
yes the folder is Login and it is at the root.
I have no folder name "Account" anywhere in my application , i am surprised where that url coming from.
I tried the "~/ " Virtual directory path . Thereis no change.
and the best part is when i convert the aplication in 3.5 it runs fine.
usedcar
Member
2 Points
4 Posts
Re: Login Url on framework 4.0 not working
Apr 01, 2012 03:34 AM|LINK
Finally I found the the Answer.
It seems there is a bug in MVC3 look at the link
http://stackoverflow.com/questions/7238369/being-redirected-to-wrong-loginurl-account-login-instead-of-account-logon
http://www.asp.net/whitepapers/mvc3-release-notes#0.1__Toc274034230
I just need to add
<appSettings>
<add key="webpages:Enabled" value="true"/>
<add key="loginUrl" value="Login/UsedCarlogIn.aspx" />
</appSettings>
And the login works fine now.
Thought this might help some one with the same problem