Last post Sep 09, 2008 11:01 PM by maxw3l
Sep 02, 2008 03:46 AM|maxw3l|LINK
I'll say from the outset that I am a complete ASP.Net Newbie.
I have had a project management system developed for me in ASP.Net and C#, and I am trying to learn from/play with the code. Users are directed to a login page when they first enter the system, which is in the /login subfolder. After a user enters their
username and password and presses the "Login" button, instead of going to /default.aspx, I am given a 404 error stating it can't find "/login/~/default.aspx".
The error seems to be related to the following code:
<asp:Login ID="cntrLogin" runat="server" PasswordRecoveryText="Forgot Password?"
PasswordRecoveryUrl="~/login/ForgotPass.aspx" CssClass="LoginSpace" Height="30px" OnAuthenticate="cntrLogin_Authenticate" TitleText=" " UserNameLabelText="User Name: " Width="348px">
<FailureTextStyle CssClass="LoginError" />
<TitleTextStyle CssClass="LoginTitle" />
<InstructionTextStyle CssClass="LoginLabel" />
<TextBoxStyle CssClass="LoginData" />
<LoginButtonStyle CssClass="LoginBtn" />
<ValidatorTextStyle CssClass="LoginError" />
<LabelStyle CssClass="LoginLabel" />
<HyperLinkStyle CssClass="LoginLink" />
<CheckBoxStyle CssClass="LoginCheckbox" />
Interestingly if I click on the "Forgot Password" URL it sends me to the correct page, so it doesn't seem to be an overall ASP.Net problem with parsing tildes - but I could be wrong?
The system works as expected on our webserver which runs SBS2003 and IIS6 and MSSQL 2005. I am running VS2008 Express SP1, MSSQL 2008 Express Edition and .Net 3.5 SP1 on Vista Ultimate SP1 with all updates installed and the same issue occurs whether I run
it via VS2008 Development Server or IIS7.
Your help is greatly appreciated because I have spent days searching trying to find a solution.
Sep 02, 2008 10:54 AMfirstname.lastname@example.org|LINK
instead of going to /default.aspx, I am given a 404 error stating it can't find "/login/~/default.aspx"
There is nothing in your posted code related to that.
Sep 02, 2008 07:44 PM|maxw3l|LINK
You are right, this is the relevant code in login.master:
<form id="frmi" action="~/default.aspx" runat="server" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;">
<Part:Header ID="Part_head" runat="server" IncludePath="../" />
The resulting HTML source becomes: <form name="aspnetForm"
style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;">
I have href="/~design/style.css" just three lines above and it correctly results in
href="../design/newstyle.css". It is a bizarre problem
Sep 03, 2008 07:41 PM|maxw3l|LINK
Can anyone shed some light on this??
Sep 04, 2008 03:05 PM|chenthil_it|LINK
In the place where u r redirecting ~/default.aspx. Use ../../default.aspx
Sep 04, 2008 07:12 PM|maxw3l|LINK
Thanks but I've tried that (it actually needs to be ../default.aspx) - it just reloads the same page.
I ended up setting up a Windows XP SP3 Virtual Machine with VS2005 Express and MS SQL 2005 Express and it works correctly. This solution is OK but I still can't understand it. There appears to be a bug in the .Net login control on Vista.
Sep 09, 2008 11:01 PM|maxw3l|LINK
FYI I figured the issue out.
In ASP.Net 2.0, action in <form id="frmi" action="~/default.aspx" runat="server" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;">
was ignored. This behaviour has changed as it is no longer ignored in ASP.Net 3.5 SP1, hence the issue. Unbelievable how much time I wasted over this!
Thanks for your attempts to help.