Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I changed the value in dropdownlist.

Now I want to identify that selectedindexchanged event is fired in other function.

Is it possible to get the fired event name in other function?
Posted
Comments
Sampath Lokuge 8-Dec-13 9:35am    
Can you put the code snippets related to the above question ?
Sergey Alexandrovich Kryukov 8-Dec-13 14:38pm    
Why? If you want to use the name in program logic, it would be a really big abuse.
—SA
BillWoodruff 8-Dec-13 23:06pm    
I think you need to re-write your question. The user's interaction with Controls, or programming logic, "fires events."

My guess is that you are describing a scenario where several Controls all use the same EventHandler for some user-action, like 'Click, and that what you want to know is which Control raised the Click Event: that's easily done.

Please clarify.

1 solution

Before SelectedIndexChanged event, it goes to Page_Load event. You can try getting the information inside that event. Below are some articles about this idea.

1. Identify during Page.Load if Button click event is going to be handled[^]
2. Get control name in Page_Load event which make the post back[^]
3. HOW TO FIND THE CONTROL THAT CAUSED POSTBACK IN ASP.NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900