首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

一个简单的登录页面出错解决方案

2012-03-05 
一个简单的登录页面出错publicpartialclass登录1:System.Web.UI.Page{protectedvoidPage_Load(objectsende

一个简单的登录页面出错
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方法贴出
[解决办法]
那就是不存在了~~~
或是写错了!
???

热点排行