Events for Dynamically created controls

G

Guest

I have a requirement to show a label and x number of buttons in all of the
pages.
So i decided to write a Base Page class and added code for dynamically
adding the label and buttons. For the buttons i have added the handlers.
Finally added the label and buttons to a place holder.

When page is rendered i am able to see the label and buttons. but when i
click the buttons events are not firing. i found two problems.

First one is when i click the buttons handlers are not firing. so i kept the
buttons in the session and added them back in the page_load event. by doing i
am able to go inside my handler function. In my handler function I am able to
fetch the information from the page, but not able to set any properties of
other controls. Like disabling a control etc.

Second one is when i write Response.write("test"), it is saying context
does't have Response object.

I think i must be doing some thing wrong.Can someone help me with the above
 
G

Guest

Bob said:
I have a requirement to show a label and x number of buttons in all of the
pages.
So i decided to write a Base Page class and added code for dynamically
adding the label and buttons. For the buttons i have added the handlers.
Finally added the label and buttons to a place holder.

When page is rendered i am able to see the label and buttons. but when i
click the buttons events are not firing. i found two problems.

First one is when i click the buttons handlers are not firing. so i kept the
buttons in the session and added them back in the page_load event. by doing i
am able to go inside my handler function. In my handler function I am able to
fetch the information from the page, but not able to set any properties of
other controls. Like disabling a control etc.

Second one is when i write Response.write("test"), it is saying context
does't have Response object.

I think i must be doing some thing wrong.Can someone help me with the above

I'm sorry I don't know the answer to your question. Rather, I have almost
the exact same problem as the first one you mentioned but I don't think I can
solve my problem the same way. I am working within a method in a class in a
library that is called from who knows what other pages. So, how do I get the
events to work?
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top