Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6040167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:28:29+00:00 2026-05-23T06:28:29+00:00

I use C# Entity Framework and Asp.net Web Forms 4. At the moment I’m

  • 0

I use C# Entity Framework and Asp.net Web Forms 4.

At the moment I’m developing the Administrator section for a Cms so I have to work with many GridView Controls for CRUD operations on my data.

I use EF as DAL and I implement my Business Logic inside every .aspx page; Pages are organized logically by folders.

My BL are pretty simple like: for User A takes from DB X, Y, Z and display it on a GridView instead for User B takes from DB only X and display on the same GridView.

In my little experience I found my self spending a lot of time in embedding my BL Roles inside each .aspx using Event Triggers Web Form Mechanism. My problem is that same pages could have the same BL and so I have to copy and paste my code in may different .aspx pages.

My questions:

  • How can I centralize my Business Logic and display data accordingly in many GridView without implement the BL in every page where the GirdView is codeded?
  • I understand a bit about Classes, could make sense implement BL in a Class and attach it to a GridView using the ObjectDataSource? Example here
  • In your experience what is the better approach to his kind of problems?
  • Could MVC approach be a solution?

Thanks for your time on this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:28:30+00:00Added an answer on May 23, 2026 at 6:28 am

    You need to layer your application – for example, in a typical scenario, you can have following projects:

    • Entities (more correctly DTO (data transfer objects)) and other classes/logic that needs to be used in all other layers
    • Data Access Layer that would handle persistence of your entities to data store
    • Business Logic Layer
    • UI Layer

    You are already made choice of EF4 as your DAL. You may use POCO entities (Code-First model) to have your entity/DTO classes in a separate project. As far as your business logic goes, put that in business layer which is actually bunch of classes that would define API. For example,

    public static class CustomerHelper
    {
       public static Customer Get(int customerId)
       {
          // do access control security
          ...
          // use EF4 to get the customer object
       }
    
       public static void Update(Customer customer)
       {
          // do access control security
          ...
          // use EF4 to update the customer object
       }
    
    }
    

    Generally, business layer can have validations, security checks, transaction control, any pre/post processing needed for the business transaction etc.

    Finally, your aspx pages will be your UI layer that would use BL classes to get/update the data. For declarative data-binding, you have to use object data source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET MVC 2.0 application using Entity Framework. All my views use
I use Asp.net 4 in C# and Entity Framework 4. My web application is
So I've started to add Entity Framework 4 into a legacy web application (ASP.NET
I hope this makes sense. I have a ASP.NET web application that uses Entity
I use Entity Framework in my ASP.NET application (.NET 3.5) My model is simple:
We use ASP.NET MVC 3 and Entity Framework 4 and annotate our entities with
I am using Entity Framework 4.0 in an ASP.NET 4.0 Web Form. All is
I'm planning to use MS entity framework for new web apps (come on EF
I am developing a rich client application that will use the Entity Framework (with
Can I use two different back ends for an .net Entity Framework project? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.