A newbie question: user controls and data binding...


Artem Ploujnikov

Hello everyone

Suppose I have a user control whose sole purpose is to edit records from a
specific data set... It has the ability to edit multiple tables at the same
time, and it might contain more than one ObjectDataSource and a few
data-bound controls. A good example of such a control is a control that
edits and/or displays multiple-choice questions.

What's the best way to pass the ID of the record being edited to that type
of control? Here's what I can think of

Option 1:
Declare a public property named QuestionId in the control and have it
programmatically set one of the parameters of the DataSource.

Option 2:
Read it directly from the session or the query string

Option 3:
Create a data-bound control and set everything up programmatically (this is
not very designer-friendly)

Are there any other options I didn't even consider?

Thank you,


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question