开发者

Is there a good way to bind a .NET CheckBoxList to a Many-To-Many relationship?

I've got a fairly simple .NET WebForms object edit form which is databound to a database. However, I've now got a many-to-many relationship that I need to implement in the form as well. In short, for this given object, the user needs to be able to select zero to many properties, which are stored in a different database table. There's also an object2property table which maps the relationships between the objects and the properties.

My initial thought is that I should be using something like a CheckBoxList, but there doesn't seem to be any good way to bind that to the the object2property table in any meaningful way. I've found some half-hacks on google, but there doesn't appear to be any standard way o开发者_开发知识库f doing this.

Am I approaching this wrong? What's the best way to implement an edit user interface for a many-to-many relationship in a .NET webform?


If I need to do something like this, i would use the same technique, one table object2property and checkboxes to let user to chose their preferences.

To me, it seems to be the most clean approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜