ObjectDataSource Binding Before I Need it

Discussion in 'ASP .Net' started by Jason Wilson, Mar 28, 2008.

  1. Jason Wilson

    Jason Wilson Guest

    I have a gridview that is using an objectdatasource that is calling a
    BLL class that wraps a Typed dataset. The objectdatasource has
    parameters that tied to page controls (textboxes, dropdowns ect) I
    had always thought that the Objectdatasource wouldn't bind while the
    gridview's visible property was set to false, but I'm experiencing
    timeouts when the page is initially loaded when the objectdatasource
    tries to bind without the necessary user input to filter down the
    results and before I make the gridview visible.

    Can anyone suggest a way to prevent the objectdatasource from binding
    untl the user has filled in the form?

    Thanks,

    Jason
     
    Jason Wilson, Mar 28, 2008
    #1
    1. Advertising

  2. Jason Wilson

    Just Me Guest

    I doubt if the visibility is the issue, but you could easily test this by
    making it visible.


    "Jason Wilson" <> wrote in message
    news:...
    >I have a gridview that is using an objectdatasource that is calling a
    > BLL class that wraps a Typed dataset. The objectdatasource has
    > parameters that tied to page controls (textboxes, dropdowns ect) I
    > had always thought that the Objectdatasource wouldn't bind while the
    > gridview's visible property was set to false, but I'm experiencing
    > timeouts when the page is initially loaded when the objectdatasource
    > tries to bind without the necessary user input to filter down the
    > results and before I make the gridview visible.
    >
    > Can anyone suggest a way to prevent the objectdatasource from binding
    > untl the user has filled in the form?
    >
    > Thanks,
    >
    > Jason
     
    Just Me, Mar 28, 2008
    #2
    1. Advertising

  3. Jason Wilson

    Jason Wilson Guest

    I'm not sure what you mean. I was saying that I tried to prevent the
    premature binding of the objectdatasource by making the gridview not
    visible. I was mistaken that would do the trick. So now I am trying
    to find another way to prevent the ods from binding before the form is
    filled out.
     
    Jason Wilson, Mar 28, 2008
    #3
  4. Jason Wilson

    Just Me Guest

    Ahh, ok. What sort of timeouts, are these SQL timeouts ? Can you get an
    exception message ?
    where exactly is this failing.

    If its breaking at a particular line, you should be able to get more
    information


    "Jason Wilson" <> wrote in message
    news:...
    > I'm not sure what you mean. I was saying that I tried to prevent the
    > premature binding of the objectdatasource by making the gridview not
    > visible. I was mistaken that would do the trick. So now I am trying
    > to find another way to prevent the ods from binding before the form is
    > filled out.
    >
     
    Just Me, Mar 29, 2008
    #4
  5. Jason Wilson

    Stan Guest

    On 28 Mar, 21:17, Jason Wilson <> wrote:
    > I have a gridview that is using an objectdatasource that is calling a
    > BLL class that wraps a Typed dataset.  The objectdatasource has
    > parameters that tied to page controls (textboxes, dropdowns ect)  I
    > had always thought that the Objectdatasource wouldn't bind while the
    > gridview's visible property was set to false, but I'm experiencing
    > timeouts when the page is initially loaded  when the objectdatasource
    > tries to bind without the necessary user input to filter down the
    > results and before I make the gridview visible.
    >
    > Can anyone suggest a way to prevent the objectdatasource from binding
    > untl the user has filled in the form?
    >
    > Thanks,
    >
    > Jason


    Dear Jason

    When binding the ObjectDataSource to the GridView with the
    DataSourceID property you have no control over when the binding
    occurs.

    If there are problems because of (intially) null parameter values then
    set the "DefaultValue" property of each parameter to something
    meaningful (DefaultValue is used when the actual parameter source - in
    this case a web server control - has null content).

    HTH
     
    Stan, Mar 29, 2008
    #5
  6. Jason Wilson

    Stan Guest

    On 29 Mar, 10:29, Stan <> wrote:
    > On 28 Mar, 21:17, Jason Wilson <> wrote:
    >
    > > I have a gridview that is using an objectdatasource that is calling a
    > > BLL class that wraps a Typed dataset.  The objectdatasource has
    > > parameters that tied to page controls (textboxes, dropdowns ect)  I
    > > had always thought that the Objectdatasource wouldn't bind while the
    > > gridview's visible property was set to false, but I'm experiencing
    > > timeouts when the page is initially loaded  when the objectdatasource
    > > tries to bind without the necessary user input to filter down the
    > > results and before I make the gridview visible.

    >
    > > Can anyone suggest a way to prevent the objectdatasource from binding
    > > untl the user has filled in the form?

    >
    > > Thanks,

    >
    > > Jason

    >
    > Dear Jason
    >
    > When binding the ObjectDataSource to the GridView with the
    > DataSourceID property you have no control over when the binding
    > occurs.
    >
    > If there are problems because of (intially) null parameter values then
    > set the "DefaultValue" property of each parameter to something
    > meaningful (DefaultValue is used when the actual parameter source - in
    > this case a web server control - has null content).
    >
    > HTH


    Oops, slight correction

    When binding the ObjectDataSource (or any other type of DataSource
    control) with the DataSourceID property of controls like GridView,
    FormView etc, then you have no control over when the *automatic* data
    binding occurs.

    You can however force it to occur manually with the DataBind() method.
    This will cause the data binding to occur in addition to when it
    happens automatically.
     
    Stan, Mar 29, 2008
    #6
    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. Guest
    Replies:
    2
    Views:
    6,980
    Guest
    Jun 28, 2005
  2. GaryDean
    Replies:
    3
    Views:
    9,574
    Luke Zhang [MSFT]
    Jan 10, 2006
  3. H5N1
    Replies:
    0
    Views:
    488
  4. 3P
    Replies:
    17
    Views:
    3,753
    Deon Claassens
    Oct 29, 2010
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

    David Thielen, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    258
    Steven Cheng[MSFT]
    Mar 23, 2006
Loading...

Share This Page