Repeat an ASP:Image button

V

VK

Hello,

I need to repeat an asp:imagebutton whch has an onclick
event associated it. Is there a way to do it?
 
L

Lucas Tam

I need to repeat an asp:imagebutton whch has an onclick
event associated it. Is there a way to do it?

Yes... bind the event dynamically to the repeated buttons with AddHandler.
 
V

VK

Thanks for your reply. But I dont know how often the image
has to be repeated. It is based on the height of the
screen. I dont know how to calculate that. Furthermore, I
would like to have only one button if it is possible. If
not please let me know how to solve that probkem.

THanks again
 
L

Lucas Tam

Thanks for your reply. But I dont know how often the image
has to be repeated. It is based on the height of the
screen. I dont know how to calculate that.

You can use Javascript or a component like BrowserHawk to get the screen
resolution.

Furthermore, I
would like to have only one button if it is possible. If
not please let me know how to solve that probkem.

You can bind the same event handler to multiple buttons dynamically. Or you
can make multiple buttons call the same event handler.

Binding the event is the easy part. Figuring the screen resolution of the
user's screen is probably what you should be focusing on.
 

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

Latest Threads

Top