Click here to Skip to main content
15,921,884 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hii ,

I want to know how to use webuser control exactly .
Say for example i want to show the same page with some logical changes as per company and employees role , is it good to handle all logic in user controls cs file or call each usercontrols methods from parent page and pass the parameters in it ,

Which is the best deal to work with it ./.


IF i directly handle the logic in webusercontrol i dont need to write anything on my parent cs file , but if i am calling those methods from parent page then i have to write and call the methods and pass the parameters into it ..


please suggest
Posted

1 solution

You don't need to call methods of UserControl. UserControl already has Page_Load Event. According to your Logic, just execute the methods inside Page_Load Event of UserControl.

So, you can handle everything inside the UserControl Code Behind.
 
Share this answer
 
Comments
Torakami 9-May-14 6:49am    
correct ... i even not writing in parents page load control ... whatever i was handling in user controls page load event and rest methods were calling from there only ...
Great. That is the right process. Please accept the answer. :)

Thanks,
Tadit
Torakami 9-May-14 7:37am    
so mean to say is no where it is required to call like this not even on parents page load event

UserControl. UserControl
No... Not needed at all.
Torakami 9-May-14 7:43am    
Thanks man .. take five star for answering my silly question . i know question wasnt so sensible .. but still i had a doubt so asked here/// thanks for clearing all my doubt on this ..

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