473,396 Members | 2,037 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.

Dynamically build ImageButton

Hi there,

I'm using C# for a webapplication. In my page I'm building ImageButtons
dynamically on Page_Load. However I want to access these Images at
runtime for example when a user clicks a button for example.

I'm trying to use the FindControl but it returns a
System.Web.UI.Control not an System.Web.UI.WebControls, and altough
using GetType() function it returns that the found control is an
ImageButton. I need that further step to be able to access that
ImageButton.
Is there a way I can do this?

Thanks

Jan 9 '06 #1
2 1415


"Varangian" wrote:
Hi there,

I'm using C# for a webapplication. In my page I'm building ImageButtons
dynamically on Page_Load. However I want to access these Images at
runtime for example when a user clicks a button for example.

I'm trying to use the FindControl but it returns a
System.Web.UI.Control not an System.Web.UI.WebControls, and altough
using GetType() function it returns that the found control is an
ImageButton. I need that further step to be able to access that
ImageButton.
Is there a way I can do this?

Thanks


Hi,

have you tried to use events? For example almost all of the components in C#
have the event onClick. If this happens you can access the image and the
information of the button easily. Their is a good documentation of events in
the MSDN Library.

mfg
Jan 9 '06 #2
Hi blablabla :P

yes basically I'm creating an event click for each ImageButton created,
and using the sender I am being able to identity which image is being
clicked. Thats ok.

However if I have a button which is indepedent of the ImageButtons
created, but this button will use that ImageButton clicked all of its
properties... I don't know if you understood, i'm not very good in
making people understand me :|

thanks for your reply :)

Jan 9 '06 #3

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

Similar topics

0
by: Meena | last post by:
I added a panel control and a image button inside the panel in a webform. When I try to dynamically add the textbox on top of the image, in the imagebutton click event, the textbox was not displayed....
2
by: Danny Bloodworth | last post by:
I have a usercontrol (login.ascx) that is very simple. It accepts input through two textboxes, and then the user clicks an Imagebutton to submit. I have a parent form that checks the page...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
3
by: sck10 | last post by:
Hello, When a person subits my web page, I do a simple check (validation) and if there are any errors, I create a variable (strValidateText) and set that value to a label on the form. What I...
2
by: Bruce | last post by:
I have a button on a form that creates multiple ImageButtons; I want each ImageButton's click event to then redirect to another URL. From doing some research, I understand this has to do with...
4
by: Jordan | last post by:
I need to dynamically add an ImageButton control to a user control and and do some server-side processing when the user clicks it. While I the ImageButton is added to the user control at runtime,...
0
by: Varangian | last post by:
Hi there, I'm using C# for a webapplication. In my page I'm building ImageButtons dynamically on Page_Load. However I want to access these Images at runtime for example when a user clicks a...
0
by: krish | last post by:
hi, I am dynamically generating Imagebutton (say 5 imagebutton, in loop) . for each imagebutton url , i am dynamically generating image and assigining to it. every thing is ok upto this...
1
by: stimul8d | last post by:
okay; ASP. I have i listbox inside a user control which is dynamically created on page_init. I check for postback and only populate the datasource if it's false. regardless, i do this ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.