Framework 2.0 Beta 2 serializing a server control at run time

J

JPHILIP

How can I persist a server control to aspx code at run time in Framework 2.0
Beta 2.
This can be done at design time with the ControlPersister.PersistControl
method.
The DesignSurface class provides a way to load components into a self
contained design time environement that should provide access to the
ControlPersister class. I foujd how to load a Windows form in it, but not a
Web Form.
Any Idea?
 
M

MasterGaurav

You must make use of ViewState.

PersistControl is not meant for direct use. It's to be used by designer
/ runtime.

btw, I assume that persisting to aspx-code means in view-state. Or am I
mistaken? Please clarify in case I've a wrong understanding of your
problem.


Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
------------------------
 
J

JPHILIP

I found a solution, PersistControl needs an implementation of the
IDesignerHost interface to work properly, so I wrote one with fonctionality
limited to what PersistControl needs to work.
I had to deassemble the private control serializer to find what it needed
and it works.
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top