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>
-->
你應該使用salt和更安全的散列。或者最好是bcrypt。 – SLaks 2011-05-17 21:15:11
我_hope_你有一個登錄cookie。 – SLaks 2011-05-17 21:23:00
我打算使用登錄cookie,但這是實施細節的第一階段。我很抱歉爲解決方案的簡單性,但我仍然找到我的方式圍繞asp.net – 2011-05-17 21:29:05