473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to retain web user control?

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
Nov 17 '05 #1
3 1588
Your page needs to create the control on postback too.

"Karl" <Ka**@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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

Nov 17 '05 #2
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

"Marina" wrote:
Your page needs to create the control on postback too.

"Karl" <Ka**@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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


Nov 17 '05 #3
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

"Marina" wrote:
Your page needs to create the control on postback too.

"Karl" <Ka**@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: KC | last post by:
Hi, I created a new event log source and log and user WriteEntry to enter the log as follows: ' Create the source, if it does not already exist. If Not EventLog.SourceExists("MySource") Then...
2
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text...
2
by: Dot net work | last post by:
I have a 3rd party link button control that when clicked does not retain it's visited color status on postback. (Actually, the first control on the form does, but all others do not.) When I...
3
by: Penny Bond | last post by:
Hi, Any help or suggestions on this one would be gratefully appreciated: I have 2 aspx pages one is called 'Query' and the other 'Details'. Query page has a number of text boxes and drop...
1
by: Harinath | last post by:
Hi All, I am working on a portal using .net2.0. In one of my page, i have FileUpload control. I am doing some server side validation for form fields in general. if there is any validation...
4
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
9
by: sweetline priya | last post by:
hi friends.. in my page the form contains 10 textboxes. the user has to fill these textfields. if the user made any mistake in entering value in any textbox, in the button click, a message is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.