Ah, I answered before you added the additional clarification. The short answer is, yes, just cast it as your custom type.
I'll leave the rest of my answer here for reference, though it doesn't appear you'll need it.
Borrowing from the code in the other question, and assuming that all your User Controls can be made to inherit from the same base class, you could do this.
Create a new class to act as the base control:
public class MyBaseControl : System.Web.UI.UserControl
{
public string MyProperty
{
get { return ViewState["MyProp"] as string; }
set { ViewState["MyProp"] = value; }
}
}
Then update your user controls to inherit from your base class instead of UserControl:
public partial class SampleControl2 : MyBaseControl
{
....
Then, in the place where you load the controls, change this:
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
to:
MyBaseControl uc = (MyBaseControl)LoadControl(controlPath);
uc.MyProperty = "foo";
PlaceHolder1.Controls.Add(uc);