views:

65

answers:

1

I am building an ASP web site that contains a large section that represents a database front end. I need to build forms to manipulate the database and obviously there would be much repitition i.t.o the type of input field and rules pertaining to the field. For example there are many tables where I have take on varchar(n) fields that could be required or not.

I was thinking to build a set of custom controls that would contain a label naming the field, an edit control (text box for example) and validators for the edit control. The custom control should automatically get the field length and set the MaxLength property as well as determine if the field is a required one and ad a RequiredFieldValidator etc. So when I create the custom control I would do something like this:

<user:UserControls_TextFieldEdit LinqObjectType="Franchise" FieldName="FranchiseName" runat="server" />

There must be a way to achieve this but I haven't I been able to find any controls/libraries that do this. I don't know how to get the field information armed with only strings representing the Linq entity name and field name.

Any help/suggestions would be appreciated.

I am using ASP.NET 3.5 and Linq.

Thanks,

Gerhard

A: 

Is Dynamic Linq what you need?

Stuart Dunkeld
No, not really.These posts got me going:http://www.codeproject.com/KB/cs/LinqColumnAttributeTricks.aspxhttp://forums.asp.net/p/1271434/2407010.aspxThanks for the reply anyway.
Gerhard
Had you said Dynamic DATA, you would have been spot on.
Gerhard