无法将类型“Maticsoft.Model.Login”隐式转换为“WebAppDL.admin.Login
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Maticsoft.BLL;
using Maticsoft.Model;
using System.Data;
namespace WebAppDL.admin
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string name = TextBox1.Text;
string pwd = TextBox2.Text;
string tip = LoginManager.CheckLogin(name, pwd);
if (tip == "您已成功登录!")
{
var ta = new Login();
ta = LoginManager.CheckLogin(name); (这里报错无法将类型“Maticsoft.Model.Login”隐式转换 为 “WebAppDL.admin.Login)
Response.Redirect("admin_welcome.aspx");
}
}
}
}
[解决办法]
var ta = new Login();
改成
var ta = new Maticsoft.Model.Login();