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

Discussion in 'ASP .Net' started by Artem Ploujnikov, Mar 31, 2007.

  1. 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,
    Artem.
     
    Artem Ploujnikov, Mar 31, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jordan
    Replies:
    2
    Views:
    2,573
    Jordan
    Feb 10, 2004
  2. Dave
    Replies:
    0
    Views:
    304
  3. Piotrek
    Replies:
    0
    Views:
    578
    Piotrek
    Aug 6, 2006
  4. JcFx
    Replies:
    0
    Views:
    318
  5. David Alexander
    Replies:
    0
    Views:
    143
    David Alexander
    Jun 18, 2004
Loading...

Share This Page