I came across an interesting behavior today. I was dynamically loading a user control into a RadTooltip using Page.LoadControl("MyUsercontrol.ascx")

Canceling the tooltip causes a partial-page postback. If I then reopen the tooltip before I do something to cause a full-page postback, the user control in the tooltip loads with the cached control state from the canceled instance. It appears that the second call to Page.LoadControl() returns an object with the same ID, and ASP.NET automatically wired it up.

My solution: in an event handler for the user control's Cancel button, I change the user control's ID to some throwaway text, like ...

 

Recently I was given a task of creating a quick example of someone making a data change to a database table then someone else being able to see the new data. Seemed simple enough. I created a WCF RIA Services application with a simple grid and submit/refresh buttons  on it. I brought up two instances of the application and had one instance change the data and the other refresh it. To my amazement the second instance didn’t see the new data.

I brought up SQL Server Profiler to see what was going on. When hitting the refresh button I ...

  I have written quite a few WCF RIA Services applications now and almost every time I need to pre-fetch some data before showing a Silverlight page or dialog. For instance you might need to get all the years and employees available to so you can put them in ComboBoxes for a dialog. You wouldn’t necessarily want to do this in the Loaded event of the dialog because the dialog will come up with empty information then fill in when the query has returned.

Another problem is that the code turns ugly and hard to manage if you have multiple ...

There have been a few instances when I would like to have an identical copy of an object but want them to be different instances. There are a few brute force ways to do this by either copying the values one by one or by using reflection to iterate over variables, properties, etc. The problem is that these methods are not very generic and need to be tweaked for each situation.

I have discovered that there are a few ways to clone an object by serializing then de-serializing an object into a new deep-copy instance of that object.

Method 1 ...