Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need some opinion, if I am using user control & aspx page, & i have the requirement to use aspx page's label depend on some condition of usercontrol.
but page_load event of aspx page is fired first , then user control's page_load event fired, so how do you able to update the label of aspx page ,on user control condition?
Posted
Updated 23-Oct-13 21:47pm
v2
Comments
Timberbird 24-Oct-13 4:17am    
You have to use Load event? No option to use others, like LoadComplete on page or PreLoad on control?
Ali_100 24-Oct-13 5:04am    
I have option to use these other event, but i want to know the other solution.

1 solution

hi
I suggest you to use a delegate in cs page which will be listening to the usercontrol events .
 
Share this answer
 
Comments
Ali_100 24-Oct-13 5:07am    
You are saying declare an delegate in aspx.cs, & fire event on ascx.cs to update the label in aspx page .?
Am i right?could you please give me the example?
Vinodh.B 24-Oct-13 5:22am    
Yes . Please refer the following link .
http://stackoverflow.com/questions/7880850/how-do-i-make-an-event-in-the-usercontrol-and-have-it-handeled-in-the-main-form
Ali_100 24-Oct-13 6:09am    
it works (y)

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