繁体   English   中英

asp.net-Web应用程序与网站-代码背后

[英]asp.net - web app vs web site - code behind

我有一个早已建立的asp.net网站。 我已经经历了使用Visual Studio将其转换为Web应用程序的过程。 现在,我已经对其进行了转换,在使用添加到项目中的类库中的类时遇到了一些麻烦。 后面的代码略有不同(如下)。 谁能给我关于解决方案的建议。

-为了澄清一点,我有3个Visual Studio项目

1个类库(数据访问层)1个类库(业务逻辑层)1个网站(表示层)->我转换为Web应用程序项目。 具有与此类似的过程( 此处

我在业务逻辑层中有一个静态方法,无法再通过表示层中的代码访问。

----网站-/Profile/Default.aspx

using MyBusinessLogic;
public partial class Profile_Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        MyBusinessLogic.Profiles.GetUserInfo(UserName);
    }
}

---- Web应用程序-/Profile/Default.aspx

using MyBusinessLogic;
namespace WebApplication1.Profile
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MyBusinessLogic.Profiles.GetUserInfo(UserName); <---ERROR "can not access method on namespace"----------------------
        }
    }
}

我在转换中也遇到过类似的问题。 如果您有共享工具,请检查类似的名称空间(Mybusinesslogic.Profiles),只需编写profile.getuserinfo并检查它是否可以解析为正确的业务逻辑程序集,或者当前名称空间中是否存在另一个重复项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM