Webpart optimizations

G

Guest

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?
 
G

Guest

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
 
G

Guest

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
 
R

Robert Bogue [MVP]

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top