日期:2014-05-19  浏览次数:20828 次

一个简单的登录页面出错
public   partial   class   登录1   :   System.Web.UI.Page
{
        protected   void   Page_Load(object   sender,   EventArgs   e)
        {

                if   (CheckLoginInfo(this.TBUserName.Text,   this.TBPassWord.Text)   >   0)
                {
                        Session[ "UserName "]   =   this.TBUserName.Text;
                        string   vFUserRole   =   Server.UrlEncode(GetRole(this.TBUserName.Text.ToUpper()));
                        string   vParams;
                        vParams   =   "Default.aspx?UserRole= "   +   vFUserRole   +   "&PassWord= "   +   this.TBPassWord.Text   +   "&UserName= "   +   this.TBUserName.Text;
                        Server.Transfer(vParams);
                }
                else
                {
                        Response.Write( " <script   defer> alert( '登录信息有误! ');window.location=window.location; </script> ");
                        this.TBPassWord.Text   =   " ";
                        this.TBUserName.Text   =   " ";
                }
        }
}
显示   if   (CheckLoginInfo(this.TBUserName.Text,   this.TBPassWord.Text)   >   0)
错误
当前上下文中不存在名称“CheckLoginInfo”
当前上下文中不存在名称“GetRole”
       



------解决方案--------------------
你的页面里是否有CheckLoginInfo方法和GetRole方法呢?
------解决方案--------------------
CheckLoginInfo方法贴出
------解决方案--------------------
那就是不存在了~~~
或是写错了!
???