Authenticated 如何引用?
using System;using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using System.Web.Authenticated;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = SiteLevel(Login1.UserName, Login1.Password);
e.Anthenticated = Anthenticated;
if (Anthenticated == true)
{
Response.Redirect("www.baidu.com");
}
}
private bool SiteLevel(string UserName, string Password)
{
bool boolreturnvalue = false;
string strConnection = "server=localhost;database=dodo;uid=sa;pwd=;";
SqlConnection Connection = new Sqlconnection(strConnection);
String strSQL = "Select * from user";
SqlCommand command = new SqlCommand(strSQL, Connection);
SqlDataReader Dr;
Connection.Open();
Dr = command.ExecuteReader();
while (Dr.Read())
{
if ((UserName == Dr["uname"].ToString()) & (Password == Dr["password"].ToString()))
{
boolreturnvalue = true;
}
Dr.Close();
return boolreturnvalue;
}
}
}
编了这层代码,如何出现以下错误
错误 1 “System.Web.UI.WebControls.AuthenticateEventArgs”并不包含“Anthenticated”的定义 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 22 11 C:\...\WebSite2\
错误 2 当前上下文中不存在名称“Anthenticated” C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 22 27 C:\...\WebSite2\
错误 3 当前上下文中不存在名称“Anthenticated” C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 23 13 C:\...\WebSite2\
错误 4 找不到类型或命名空间名称“SqlConnection”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 32 9 C:\...\WebSite2\
错误 5 找不到类型或命名空间名称“Sqlconnection”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 32 40 C:\...\WebSite2\
错误 6 找不到类型或命名空间名称“SqlCommand”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs 34 9 C:\...\WebSite2\
希望大家给予下帮助! --------------------编程问答-------------------- using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using System.Web.Authenticated; 为什么注释掉这个using?
--------------------编程问答--------------------
赞同,我也想知道
补充:.NET技术 , .NET技术前瞻