0
Server Error in '/' 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: /login.aspx

The odd thing is there is no login.aspx file in the solution space and there is no reference to it anywhere in the code file of the aspx file.I have attached the code below

protected void Onbutton_click_login(object sender, System.EventArgs e)
    {
        var dbcontext = new PrepLicensingSolution2010.DAL.LicensingEntities1();
        var user = dbcontext.userpassword(loginName.Text);
        string HashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "sha1");
    if (user.FirstOrDefault() == HashedPassword)
    {


        Response.Redirect("/Members/members.aspx");

    }
    else
    {
        Response.Redirect("signin.aspx");
    }

}

protected void rbUser_Index_Changed(Object sender, EventArgs e)
{

    if (rbUser.SelectedItem != null)
    {
        if (rbUser.SelectedItem.Value == "0")
        {
            Response.Redirect("signup.aspx");
        }
        else
        {
            rbUser.SelectedIndex = 1;
        }
    }
}

Any inputs would be great since I wasnt getting this error last week and started getting it only after we moved to a new office,So I am wondering if this is something to do with the network setup

Well I checked the forms authentication on the web.config and I dont see anything there which explains that issue

The code is below

<authentication mode="Forms" />
<!--
        The <customErrors> section enables configuration 
        of what to do if/when an unhandled error occurs 
        during the execution of a request. Specifically, 
        it enables developers to configure html error pages 
        to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
        <error statusCode="403" redirect="NoAccess.htm" />
        <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    -->
4
  • You should use salt, and a more secure hash. Or preferably bcrypt. Commented May 17, 2011 at 21:15
  • I hope that you have a login cookie. Commented May 17, 2011 at 21:23
  • I am planning to use a login cookie but this was the first stage of implementation detail.I am sorry for the simplicity of the solution but I am still finding my way around asp.net Commented May 17, 2011 at 21:29
  • I highly recommend that you scrap this and use standard forms auth instead. Writing secure code is hard; you should use Microsoft's tested implementation instead. Commented May 17, 2011 at 21:31

1 Answer 1

1

You probably have forms authentication setup to redirect to Login.aspx in Web.config.

Sign up to request clarification or add additional context in comments.

5 Comments

Or maybe the iis has it set as the only default page. Or if this is in dev studio not a remote server, it could be referenced in the the application web properties page. Your probably right though.
Assuming IIS has set it as a default,how do I override it?
It sounds like you aren't using forms authentication. If so, remove it from Web.config.
that worked perfectly ,thanks so much ,can you explain why that was the root cause of the problem?
Forms authentication uses a Login.aspx. If you aren't using Forms auth, you shouldn't try to enable it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.