473,322 Members | 1,610 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,322 software developers and data experts.

How do I return the name (ID) of the User Control that Raised an Event?

Hello,

I have a user control (contains two listboxes, labels and radio buttons)
that appears on my webpage multiple times. When the radio buttons are
clicked I am able to process (consume?) that Event (SelectedIndexChange) on
the main page.

What I am having a problem with is figuring out which of the user controls
raised that Event. If I know which user control raised the Event I hope to
then refill the listbox with new data.

How do I tell which user control's radio buttons I clicked?

I have this pseudo-code on the main page:
private void WebForm1_SelectedIndexChange(object sender, EventArgs e)
{
DoFunction( User Control Name);
}

I tried sender.GetType().ToString() but that just told me the user control
(UserControl.ascx) and not the actual ID that I assigned to it.

Any help would be greatly appreciated.

Thank you.

p.s. I saw something about a nested Class in the user control that contains
the ID or other information about it, but I certainly don't understand that.
Sep 13 '06 #1
0 1157

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

Similar topics

0
by: Alain | last post by:
Hello, I am trying to dynamically add many instances of a user control inside a placeholder. The user control exposes an event raised when a button is pushed. How can I handle such event for...
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
8
by: Prince Mathew | last post by:
Hi All, I have a requirement. I am throwing an exception from my user control I want to catch this in my container page. Is this possible? I don't want any event to be raised. PLEASE...
6
by: Art | last post by:
Hi I'm new at this and need some help. I have a "solution" with 2 projects - the main project and a library. The library is simple, it contains a text box that will appear many times in the form...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: weboweb | last post by:
Hail the experts!!! I'm creating a web user control which displays a hierarchical tree of items from an xml string passed to the control (from the host page) through an exposed property. This...
2
by: Gummy | last post by:
Hello, I have a user control that has radio buttons and a listbox. This user control is repeated several time on my webpage. What I want to do is alert the main page that the radio buttons...
3
by: rn5a | last post by:
A DataGrid has a BoundColumn, an EditCommandColumn & a few TemplateColumns. When the text in the EditCommandColumn within any of the DataGridItems is clicked, the corresponding BoundColumn changes...
1
by: BrenB | last post by:
I'm trying to trap for an event in my user control so that I can manage the state of the user interface. The control is used to enter data into a database. The control contains a tab control...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.