2011-05-17 107 views
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 

奇怪的是,解決方案空間中沒有login.aspx文件,並且在代碼文件中沒有任何引用它的地方在ASPX file.I附上以下在asp.net中獲取「/'應用程序」中的服務器錯誤

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; 
     } 
    } 
} 

的代碼,因爲我不是上週收到此錯誤,並開始得到它之後,纔會搬到新的辦公室的任何投入將是巨大的,所以我想知道如果這是與網絡設置有關

那麼我檢查了web.config上的表單身份驗證,我d ONT看不到有這解釋了這個問題

的代碼如下

<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> 
    --> 
+0

你應該使用salt和更安全的散列。或者最好是bcrypt。 – SLaks 2011-05-17 21:15:11

+0

我_hope_你有一個登錄cookie。 – SLaks 2011-05-17 21:23:00

+0

我打算使用登錄cookie,但這是實施細節的第一階段。我很抱歉爲解決方案的簡單性,但我仍然找到我的方式圍繞asp.net – 2011-05-17 21:29:05

回答

1

你可能有窗體身份驗證設置重定向到Login.aspx在Web.config中。

+0

或者iis已將它設置爲唯一的默認頁面。或者,如果這是在dev studio而不是遠程服務器,它可以在應用程序的web屬性頁面中引用。雖然你可能正確。 – asawyer 2011-05-17 21:17:51

+0

假設IIS已將其設置爲默認值,我該如何覆蓋它? – 2011-05-17 21:21:40

+0

這聽起來像你沒有使用表單身份驗證。如果是這樣,請從Web.config中刪除它。 – SLaks 2011-05-17 21:22:31

相關問題