how to retain web user control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I am using asp.net with c#. I created a web user control "MyControl". When I
click a button, page creates an instance of "MyControl" and loads it at run
time. It is good. And the "MyControl" has a button in it which can do some
magic work. But when I click this button in MyControl, page reloads and
"MyControl" disappears. I know "Mycontrol" is created at run time and when
page reloads, the creating event is not triggered. It is right.

My question is: how to retain this dynamic control over pages? Is it possible?

thanks,

Karl
 
Thanks for the reply, marina.

It is helpful but not solving the problem completely. When I click the inner
button in the "MyControl", I am doing something. So I want to retain the same
state of MyControl. As you said, I can create a new MyControl but I loose all
the states of the change I made on the old MyControl. Is there a way to solve
this problem?

Thanks,

Karl
 
Thanks for the reply, Marina.

Here I have a further question. Because I did some work when I click the
MYControl button, I want to retain the states of MyControl. How to do it on
postback?

Kai
 

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

Back
Top