.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Business object design in master details.

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Hello guys, I have the following scenario,

  1. There is a master business object containing 40 fields
  2. 2 separate child business objects
  3. If I update a child record, I have to update master's 'Last modify by' status along with 3 or more fields in master
  4. For this purpose, I don't want to initialize a separate Master class object (as most of the fields are unused/wasted)
  5. The 'last modify by' also gets updated if the records in master get updated themselves

Currently I have separate business objects for master table, Child 1, Child 2 etc.

How do I control this in my business object design ? Do I break up my master object ? Say I extract last 'modify by ' into a new class, through inheritance or some other way ?

Is there a way that whenever child gets updated I use a 'small' class to update Master status only and whenever the master itself gets updated I do the same.

Problem is that I am having redundancy in my small class (Master class also contains 'Last Modify By ',

What would you advice. Please have your say. Thank you.

Edit  I am using webforms guys.

View Complete Post

More Related Resource Links

Master Pages: Master Your Site Design with Visual Inheritance and Page Templates


Master pages in ASP.NET 2.0 solve a problem many Web developers have been solving on their own with a variety of techniques for years - providing a single master template for an entire site. This article covers the details of master pages, discussing their usage and implementation and how they are a natural evolution of custom techniques developers are using today.

Fritz Onion

MSDN Magazine June 2004

BizTalk: Implement Design Patterns for Business Rules with Orchestration Designer


Because the value of good software planning and design should never be underestimated, it can be beneficial to use one of the many existing design patterns as a foundation for solving some of your toughest architecture problems. This article describes several traditional design patterns including the Observer pattern and the Dispatcher pattern, elaborates on their structures, what they're used for, and how they can help you build a BizTalk-based solution. Following this is a discussion on using the BizTalk Orchestration Designer to build designs and integrate existing business processes.

Christian Thilmany and Todd McKinney

MSDN Magazine October 2001

Managing business object locks on application level

Today I worked out simple application side object locking solution for one server scenario. My motivation came from ASP.NET architecture forum thread How to solve concurrent site issue where one user asks for locking solution that works without changing database. Here is my simple and primitive solution that should help this guy out. I added also sample solution to this posting. My solution is simple: Create class for locked items. Create manager class that holds locks and manages them. Clear locks when session ends. Create page to release all locks. If you need something more serious then you should keep locks information in database or better than that - use some lock server. Also you may consider developing WCF service. LockItem class As a first thing let's create class that keeps lock information. I call this class as LockItem. This class doesn't hold references to locked objects - only type and ID as there are many business layers that doesn't use globally unique identifiers for objects. public class LockItem {     public Type ObjectType { get; set; }     public int ObjectId { get; set; }     public string SessionId { get; set; }     public DateTime LockedAt { get; set; } } LockItem class also contains property for session because otherwise it is not possible to kno

CommunicationException when serializing my business POCO object

Hi! I'm currently blocked by a strange problem, here is the situation: I've a client and a server, running with .Net 4.0 framework. I'm using Entity Framework server side, and WCF to communicate between client and Server. I use POCO object on my Entity Framework model. One month ago, I had a problem: In some case entity framework has already loaded an object and then want to return it when the WCF service is queried. Example: An User has a collection of Orders, and Orders knows which User handle it---> cyclic references I searched online how to resolve this and I found this: http://chabster.blogspot.com/2008/02/wcf-cyclic-references-support.html It worked like a charmed for me until now. I can get data from the server without server, ... Now I'm trying to call my Save(User) method from the client to the server, and I get this error:   System.ServiceModel.CommunicationException was caught Message=There was an error while trying to serialize parameter http://tempuri.org/:User. The InnerException message was 'Type 'System.DelegateSerializationHolder+DelegateEntry' with data contract name 'DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribu

Details View Biding Custom Object with Enum properties fields

Hello, I'm trying to bind custom object to details view. The problem is that enum property fields are not show.Is there any way to show enum property fields in details view ?I put some example code below (I do not specify any rows mappings, they are generated dynamically because different kind of objects are bound to details view):// My object public class OrderItem { public ItemKindEnum unitemizedItemKind { get { return (ItemKindEnum)this.unitemizedItemKindID; } } ... } // Details view configuration <asp:DetailsView ID="dvOperationDetails" runat="server" DefaultMode="ReadOnly" ... />

How Would I Design a Trigger Based on Object Type?

I have doing some research trying to figure out how I could create a trigger or datatemplate that would react based on an Object's type, but haven't found a decent explanation. In code I could use "GetTyoe()" but I am unsure if that is possible in XAML. As a basic example, if the Object is of Type "A" I want to bind the content of a label to a certain property of object "A", but if the object is of Type "B" I want to bind to a different property. I guess the big question is: How do I determine an objects type from XAML?

Exception Details: System.NullReferenceException: Object reference not set to an instance of an obje


Hi, i have a Problem, i made a ASP.NET Page with VS2010 and now i want to run it on a iis6 (windows server 2003) and i get the message:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.


Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]

   Bestellung.Bestellung.ImageButton1_Click(Object sender, ImageClickEventArgs e) in D:\foo.aspx.cs:71

   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115

   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120

   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13


How to design a Centralised Business or Service Authendication Architecture in ASP .Net


Hi All,

i want to create a centralised business or Service authendication architecture in .net. for example, we have a clients like c1, c2, c3, c4, ... etc. everybody logins seperatly as well as grouply. ie, if client  "C1" logins [with login authentication] he can access c2 , c3, c4 also without login authendication. So its like a google.  if we enters gmail  account, we can access orkut, picasa like that.. i need the cetralised architecture.

And, client "c1" seperately asks seperately how will be the authendication architecture.

so give me the single solution for both these two scenarios.... how will be the architecture for these two and how is the Data Base (Login) Structure.

Thanks in Advance.

with Regards


System.StackOverflowException occur while Serializing Business Object which implements INotifyProper

I try to implement the NTier scenario for a sample application using Remoting, but while try to implement this it giving me the error that SOAP serializer doesn't support serialization of generic List of....blah blah,,,
So I decided to implement my own serialization process like mentioned below and it works fine,

This is the Interface of the DataCentric Component
 obj As
 Custs) As

'This is where I want to talk to database(haven't implemented yet in this code)<br/>


 obj As

Two Copies of an object when choosing business object in objectdatasource


I'm having a problem that I cannot resolve.

I have created a business object that I have placed in my web apps app_code directory.  When I try to reference this object with the objectdatasource 'configur datasource' wizard I see two copies.

If I select one and run I get the following exception:

The type 'SPFSimulatorWeb.App_Code.ModuleBLL' is ambiguous: it could come from assembly 'C:\Users\myusername\AppData\Local\Temp\Temporary ASP.NET Files\root\95af94a9\fff6b138\App_Code.y7vbcqg4.DLL' or from assembly 'C:\Users\myusername\Simulator Development\SimDevelopment\SimulatorWeb\bin\SimulatorWeb.DLL'. Please specify the assembly explicitly in the type name.

I believe that this problem started after I switched one of the references from an .exe from another project to a DLL.  Now I see two copies of whatever the class I make in my App_Code directories.  I have tried deleting the temporary folder but the same error results.  I have even removed the web application from my solution and deleted it, started a new web app, renamed my business object class but the same thing happens. 

I'm pulling my hair out over this.  Has anyone ever seen anything like this?  I've read some of the other threads where they just deleted files or cleaned there solutions but that has not w

Master page design



i am a new bee in asp.net.

I am now degining my web design  in master page so that all the web pages will have the same and consisten look.
I have go thorugh online and find out that almost all the design is done in table with height= px/% and width=px/%

The way is i do is to have a table with width=100% and height=XX px for the master page.
Header, navigation menu, footer are all rows/columns in the table.

My master page design is like this :

 <navigation menu>  | <content page>

DataBinding not updating underlying business object when changing control property from code


I have a custom data form control that in code generates databindings between the selected custom business object (LLBL) and the various controls on the screen. Everything works in that I set the DataContext to the selected business object and the data appears in the GUI. If the user changes anything on screen, the data is getting updated into the business object.

However, now I have some custom logic that when the user presses a button I need to update some fields. Currently I'm setting this data directly into the controls, setting the new value into the property that is bound. However, the data is not getting pushed back into the business object.  I had this same issue building WinForm apps in that databinding only fired if the user was in the control and left it.

Does the same thing apply to WPF? How can I get ANY change on say a TextBox's Text property whether via user interaction or from C# code to push that value into the bound business object property?


retrive details records as a field in master table


I have 2 tables:

Student table with Id, Name fields

Phone table with Id,StudentId,PhoneNumber

Now, I want to show student list with all it's phone numbers in 1 row.

this query: "select student.*, phone.* from student inner join phone on student.id=phone.studentid" shows me the list of students with duplicate per each phone number.

I want something like this:

1 paul       66665566,7766665

2 ben        5566556,8877667

3 sam       4444334,3454332,7656765

Master/Details within UpdatePanel


I was wondering if anyone could help me. I have an updatepanel, within which is a gridview of customer names and a user control. This user control contains a details view of the selected customer and has a public property to get and set this.

The problem I'm having is that I have to select a customer twice before the detailsview will show the change.

The key areas of my code are:

Main Webform:

            <asp:UpdatePanel ID="GridUpdatePanel" runat="server" UpdateMode="Conditional" >
                <asp:GridView ID="GridView1" runat="server" CssClass="gv"></asp:GridView>
                <uc2:SimplePV ID="SimplePV1" runat="server" />

Main Webform Code Behind:

        protected void Page_Init(object sender, EventArgs e)
            GridView1.SelectedIndexChanged += new EventHandler(GridView1_SelectedIndexChanged);

        private void bindProductsGrid()
            //SQL Data Source details go here....

            GridView1.AutoGenerateColumns = false;

            //Columns Details go here...

InfoPath 2010 master details form, Submit data to muliple Form Library

I have 2 Form library
Library 1 :
    Employee ID
    Employee Name
    Employee Age
Library 2 :
    Employee ID

I want to create one form using Info Path as master details form. i.e for Library 2 repeating field.
How we can do this any one have any idea.

I have tried to submit this form data into 2 data connection in info path, but its not working ....

Design master page header and footer in reporting service


Dear sir/madam,

I would like to design master page header to show report title and date. For Master footer page, I want to show address and page number. Thus, all report no need to design more page header and footer.

I look forward to hearing from you.

Thanks in advance,

jQuery and Master Pages - Object expected


Here is the layout of my problem: I have a Master Page that is referenced by pages in the root of my site, as well as some pages in an 'Admin' folder. All of that works just fine. I added some jQuery to add some features to an auto-search textbox, and placed the code referencing the jQuery file and the script in the head section of the Master Page. The script looks a little like this:  

       SelectText(this); // Function to call on click event.

I just used the actual id generated by ASP.NET to grab the textbox to avoid the "what's the actual id?" issues. When the home page loads, all is well. When I try to navigate to one of the pages in the 'Admin' folder, I get an 'Object expected' error. At first I thought it was due to a possible renaming of my textbox, but I checked the source of the page and this was not the case. In fact, I removed all of the script code except the:


part, and the 'Object expected' error still occurs. I am only setting up the jQuery here, and it still throws an exception. I have no idea what is causing
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend