Microsoft模式和实践3层体系结构命名空间问题 [英] Microsoft pattern and practice 3 tier architecture namespace problem

查看:92
本文介绍了Microsoft模式和实践3层体系结构命名空间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中我正在使用micrsoft pattren和练习课程(3层架构)



现在解决方案资源管理器



i有



appcode



BLL - >我自己的课程



DAL - > sqlhelper.cs DBBridge.cs(内置clasess)



但问题是BLL classess无法访问我的aspx页面的代码隐藏。



i还将这个名称空间projectName.BLL添加到我的aspx页面但仍然无法访问我的bll函数?



示例



in bll



clsadmin.cs(class)



in My project i am using micrsoft pattren and practice classes(3 tier architecture)

now in solution explorer

i have

appcode

BLL--> my own classes

DAL--> sqlhelper.cs DBBridge.cs (built in clasess)

but the problem is BLL classess are not accessing on codebehind of my aspx pages.

i have also add this namesspace projectName.BLL to my aspx page but still i cannot access my bll function ?

Sample

inside bll

clsadmin.cs (class)

<pre lang="css">using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MCQs_Test_System.DAL;
using System.Data.SqlClient;
using System.Data;


namespace MCQs_Test_System.BLL
{
    public class admin_Program
    {
        private const string _spName = "AdminDegree";

        private DBBridge ObjDBBridge = new DBBridge();
.
..
.
...
..







和我的aspx代码隐藏文件是






and my aspx codebehind file is

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MCQs_Test_System.BLL;


namespace MCQs_Test_System
{
    public partial class DegreeProgram : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}





你可以看到这个



you can see this

using MCQs_Test_System.BLL;





但这显示错误bll在命名空间中不存在...



but this is showing error "bll does not exist in the namespace...

推荐答案

只是你需要这样做



转到

appcode



BLL- - >(我自己的班级)你有类在这里左键单击它选择属性然后转到更改构建动作专业版perty to Compile 。在所有课程和DAL中都这样做。



DAL - > sqlhelper.cs DBBridge.cs(内置clasess)



现在你可以访问BLL类了。给命名空间引用aspx的代码隐藏文件。

simple
simply you are need to do this

go to
appcode

BLL--> (my own classes) You have classes here left click on it select property then go to Change Build action property to Compile. DO this with all classes and also with DAL.

DAL--> sqlhelper.cs DBBridge.cs (built in clasess)

now you can access BLL classes . give the namespace reference to aspx's codebehind file.
simple


这篇关于Microsoft模式和实践3层体系结构命名空间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆