Accessing property of User Control

K

KK

Hello,

I´m new to ASP.NET and I'm trying to solve this problem:

I want to have two checkboxes and a submit button in my user control. This
user control will also have one public read-only propery (called e.g.
"Number") which will be "1" if both checkboxes will be checked and "0"
otherwise. This user control will be included in some webpage, that will
have one additional Label and nothing else.

Is it possible to write "1" or "0" to the Label depending on what user
checked in user control? I tried to "calculate" my property "Number" in
SubmitButton.Clicked event and read this property in Page.Load event but it
looks like this event executes before UserControl.SubmitButton.Clicked.

The only solution that I can see now is to move the button from the user
control to the page - than it should work. Is there any other solution?

Thanks Borek.
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top