Webpart optimizations

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9obiBHcmFudA==?=, May 2, 2006.

  1. I only want to refresh my data in my webpart when the custom properties
    change. Is there an easy way to know that the user changes one of the
    properties?

    p.s. I have my Dataset.GetData() and DataBind() calls in the Page_PreRender
    Event so I will get the latest custom property value. Is this the right
    place?
     
    =?Utf-8?B?Sm9obiBHcmFudA==?=, May 2, 2006
    #1
    1. Advertising

  2. General Grant,

    I know of no event for this. You can check in the property set method if
    the value has changed and in a custom editor you can check if the property
    changes in the applychanges method.

    Me I know the datasource is cached so I don't worry about optimizations its
    all been done forme and would rather make things the work correctly with the
    highest quality than something that could potentially fail because of
    optimization code techniques, but I'm just a hack.

    Good Luck
    DWS


    "John Grant" wrote:

    > I only want to refresh my data in my webpart when the custom properties
    > change. Is there an easy way to know that the user changes one of the
    > properties?
    >
    > p.s. I have my Dataset.GetData() and DataBind() calls in the Page_PreRender
    > Event so I will get the latest custom property value. Is this the right
    > place?
    >
     
    =?Utf-8?B?RFdT?=, May 3, 2006
    #2
    1. Advertising

  3. I built the solution using a data source to start, but I can't share them
    easily across webparts. So I created a dataset. Maybe I should just cache
    my dataset. :)

    -John

    "DWS" wrote:

    > General Grant,
    >
    > I know of no event for this. You can check in the property set method if
    > the value has changed and in a custom editor you can check if the property
    > changes in the applychanges method.
    >
    > Me I know the datasource is cached so I don't worry about optimizations its
    > all been done forme and would rather make things the work correctly with the
    > highest quality than something that could potentially fail because of
    > optimization code techniques, but I'm just a hack.
    >
    > Good Luck
    > DWS
    >
    >
    > "John Grant" wrote:
    >
    > > I only want to refresh my data in my webpart when the custom properties
    > > change. Is there an easy way to know that the user changes one of the
    > > properties?
    > >
    > > p.s. I have my Dataset.GetData() and DataBind() calls in the Page_PreRender
    > > Event so I will get the latest custom property value. Is this the right
    > > place?
    > >
     
    =?Utf-8?B?Sm9obiBHcmFudA==?=, May 3, 2006
    #3
  4. You could always add a flag that gets set when the setter on the property is
    called and use that to determine if anything has changed. It's a bit
    tedious but not that bad really.

    Rob

    --
    Robert L. Bogue, MS MVP, MCSE, MCSA:Security, Etc.
    Blog: http://www.thorprojects.com/blog
    "John Grant" <> wrote in message
    news:...
    >I built the solution using a data source to start, but I can't share them
    > easily across webparts. So I created a dataset. Maybe I should just
    > cache
    > my dataset. :)
    >
    > -John
    >
    > "DWS" wrote:
    >
    >> General Grant,
    >>
    >> I know of no event for this. You can check in the property set method if
    >> the value has changed and in a custom editor you can check if the
    >> property
    >> changes in the applychanges method.
    >>
    >> Me I know the datasource is cached so I don't worry about optimizations
    >> its
    >> all been done forme and would rather make things the work correctly with
    >> the
    >> highest quality than something that could potentially fail because of
    >> optimization code techniques, but I'm just a hack.
    >>
    >> Good Luck
    >> DWS
    >>
    >>
    >> "John Grant" wrote:
    >>
    >> > I only want to refresh my data in my webpart when the custom properties
    >> > change. Is there an easy way to know that the user changes one of the
    >> > properties?
    >> >
    >> > p.s. I have my Dataset.GetData() and DataBind() calls in the
    >> > Page_PreRender
    >> > Event so I will get the latest custom property value. Is this the
    >> > right
    >> > place?
    >> >
     
    Robert Bogue [MVP], May 26, 2006
    #4
    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. niju

    Optimizations

    niju, Aug 21, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    405
    tom pester
    Aug 21, 2005
  2. Rob Adelberg

    switch statement optimizations

    Rob Adelberg, Sep 18, 2003, in forum: C++
    Replies:
    5
    Views:
    384
    Ron Natalie
    Sep 18, 2003
  3. Scott Robert Ladd
    Replies:
    2
    Views:
    366
    Gianni Mariani
    Nov 17, 2003
  4. zb32

    bitfield optimizations

    zb32, Jul 13, 2004, in forum: C++
    Replies:
    1
    Views:
    1,076
    David Harmon
    Jul 13, 2004
  5. anars
    Replies:
    0
    Views:
    376
    anars
    Jan 7, 2007
Loading...

Share This Page