Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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)

C#
<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();
.
..
.
...
..



and my aspx codebehind file is

C#
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
C#
using MCQs_Test_System.BLL;


but this is showing error "bll does not exist in the namespace...
Posted
Comments
me.ajaykumar 8-Sep-13 0:12am    
these are three different projects, so have you added references to the projects ?
Dholakiya Ankit 9-Sep-13 1:06am    
yes agree
Muhamad Faizan Khan 8-Sep-13 7:40am    
this files in the same project inside my project's Appcode folder

1 solution

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
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Feb-14 11:40am    
Who is "you"? Are you talking to yourself this way. This is a fake answer.
—SA
Muhamad Faizan Khan 14-Feb-14 11:48am    
i asked this question but didnt got. after too many tries finally i got then i share here for other ok
Sergey Alexandrovich Kryukov 14-Apr-15 2:44am    
No who is that "you"? It sounds so much of fake...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900