In Progress

Implementing Stateful Complex Property in an ASP.NET Server Control (C#.Net 2.0)


I have developed an ASP.NET Server control where I have created lots of properties of different types like string, bool, enum etc...



string marketName, string companyName

string bookName, decimal bookPrice, string authorName

string studentName, int studentID, int studentAgae


Now, I wanted to organize those properties within classes like

public class BookInfo


string bookName, decimal bookPrice, string authorName


public class StudentInfo


string studentName, int studentID, int studentAgae


Then I want to appear those grouped properties within the Property Editor in Design Time same like Style or Font classes are shown up in the property editor as a tree.

Finally, all sub properties must be stateful (i.e. store these properties in ViewState). So, you may need to override LoadViewState, TrackViewState, SaveViewState etc methods.

Two very important requirement :

1] The sub properties must be editable in designmode in property editor like Font class or Style Class.

2] The sub properties must maintain State information within ViewState.


The format of required Article:


Now, I want an easy Visual Studio 2005 (.NET 2.0) Custom Server Control Project with clear comments and the project should have following items.

1] A custom server control with mentioned Book Class, StudentInfo Class and non classed properties where you have implemented State Management for sub properties and also those sub properties are shown up in property editor.

2] The partial class should be used to divide the property definitions in one file, Load View State, Save View State, Track View State etc in another file, Custom Class definitions (i.e. BookInfo, StudentInfo etc) in another file.

3] The complete project should be easily coded so that the solution can be used as a model to create a similar project or add more and more properties within classes and all new properties are easily scalable to implement state management.

Thats all.

Before grouping the properties within classes, an used can access a property within code file like this:

Say the instance name of my control is "myCustomControl":

so, in order to access BookPrice, the user uses,
int price = myCustomControl.BookPrice;

After your modification, the user should be able to get or set the BookPrice within the code like this,

int price = myCustomControl.BookInfo.BookPrice;

I hope I have clarified my requirements.

Skills: .NET, Website Design, Windows Desktop

See more: server control complex property example, stateful property asp, class stateful, state management complex properties, server control bool property, custom control sub properties, complex properties, asp net custom control complex property, complex property aspnet, website editor wanted, up string, i want an editor, int i, i need the format of an article, control, clear a string in c, article model, enum property viewstate, sub property propertyeditor, user control complex property, aspnet complex control properties, asp page stateful, custom control comples preperty vs2005, stateful aspnet user controls, aspnet server control property editor url

About the Employer:
( 14 reviews ) Whitby, Canada

Project ID: #213490