Rank: Member Groups: Member
Joined: 6/11/2007 Posts: 15
|
I created a Dialog declaritively (in .aspx) and wanted to use it as a starting place for Dialogs I create programmatically.
I would like to say something like:
EO.Web.Dialog d = new EO.Web.Dialog(baseDialog); //customize d here
but there is no copy constructor.
I tried using the serialization trick of:
MemoryStream m = new MemoryStream(); BinaryFormatter f = new BinaryFormatter(); f.Serialize(m, baseDialog); m.Seek(0, SeekOrigin.Begin); EO.Web.Dialog d = (EO.Web.Dialog)f.Deserialize(m);
but EO.Web is not marked as serializable.
Can you provide either a) a code around b) a copy constructor for each EO control c) mark the assembly as serializable?
Thanks,
Perry
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi Perry,
You can't really it do it that way. :) ASP.NET Controls work very differently. The closest thing that you have is ControlPersister.PersistControl and ControlParser.ParseControl. But you would need an IDesignerHost for that. The easiest way for you would be saving the dialog as a UserControl and then use LoadControl to load it.
Thanks
|
Rank: Member Groups: Member
Joined: 6/11/2007 Posts: 15
|
Thank you.
|