asp.net初学设置用户登录界面出现下面这种错误~拜托大神帮帮忙~

来源:互联网 发布:mac电脑忘记开机密码 编辑:程序博客网 时间:2024/06/05 10:39
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Model;
using BLL;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string name = TextBox1.Text.Trim();
        string pwd = TextBox2.Text.Trim();
        User U = new UserManager().UG(name, pwd);
        if (U == null)
        {
            Response.Write("用户名或密码输入错误,请重新输入");
        }
        else
        {
            if (U.Role == "admin")
            {
                Response.Redirect("Admin.aspx");
            }
            else
            {
                Response.Redirect("User.aspx");
            }
        }
        
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}


错误 1 无法将类型“Model.User”隐式转换为“User” C:\Documents and Settings\Administrator\桌面\Class\Web\Default.aspx.cs 25 18 C:\...\Web\
错误 2 “User”不包含“Role”的定义,并且找不到可接受类型为“User”的第一个参数的扩展方法“Role”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\Administrator\桌面\Class\Web\Default.aspx.cs 32 19 C:\...\Web\

0 0
原创粉丝点击