Datasource parameters?

Discussion in 'ASP .Net' started by Ben, Jan 4, 2007.

  1. Ben

    Ben Guest

    I'm having difficulty getting a parameter value used in an Object Data
    Source that populates a GridView control. Here's the overview:

    GridView 1 has a button on it which the user clicks to drill down into data
    subordinate to the record they're looking at. When the button is clicked,
    GridView2 is supposed to populate with data from another table, filtered by
    a field on the row in GridView1 whose button was clicked.

    Right now the only way I can get it working is to have the key field for
    GridView2 stored as a Session variable (done in the RowCommand event of
    GridView1 when the button is clicked), and then tell the Object Data Source
    for GridView2 that the key is that session variable (that's done when
    configuring the object data source).

    Is there a way to tell the Object Data Source to get its value from, say, a
    property of the Page? According to the dropdown list in the Configure Data
    Source / Define Parameters window, my only choices are "None", "Cookie",
    "Control", "Form", "Profile", "QueryString", and "Session". I tried 'Form',
    using a public property to store the parameter value, but couldn't get that
    to work.

    Other than Session, is there another way?

    Thanks.
    Ben
    Ben, Jan 4, 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. Brock Allen

    Re: Datasource parameters

    Brock Allen, Sep 20, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    467
    Not Me
    Sep 23, 2005
  2. Greg Ramsey
    Replies:
    0
    Views:
    758
    Greg Ramsey
    Mar 19, 2006
  3. Jim McGivney
    Replies:
    1
    Views:
    452
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 3, 2006
  4. Replies:
    0
    Views:
    333
  5. johnnyD
    Replies:
    0
    Views:
    343
    johnnyD
    Oct 4, 2006
Loading...

Share This Page