简体   繁体   中英

How to call the event of usercontrol in page of aspx

I have created the usercontrol. There is event :

public event System.EventHandler MemberSelectionChanged; 

I have called this event in aspx page like this(given below). It working fine. Is there any other way to call the user control event in aspx page.

this.ucMemberList.MemberSelectionChanged += new EventHandler(MemberList_MemberSelectionChanged);

Shalni, if under "calling" you mean assigning handler to an event, so you did it right way. Not aware of other ways.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM