Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
I want to use some usercontrols in one asp.net web form. usercontrols load with ajax. That's ok but what are the disadvantages of usercontrols? I need some advices for usercontrols, should I use them or not? Or you prefer ajax update panel?
Thank you all
Posted
Comments
Ankur\m/ 14-Oct-13 7:47am    
It's absolutely alright to use multiple user controls on a page. But what are you trying to achieve? What do you mean user controls load with ajax? You must register your user control before you can use it in a page.
Again what does update panel has to do with a user control?
ds.nr 14-Oct-13 8:14am    
I actually mean what are the disadvantages of using lots of usercontrols in a page. No postback would be a problem or? What things should I be carefull when I use them.
Thanks...

1 solution

UserControls can be a good option always when you intent re usability, fragmented caching for performance improvements etc. So here it can be number of usercontrols which targets your webpage. Ajax update panels are not a substitute for usercontrols since we can have multiple update panels to load multiple usercontrols depending upon how you need to handle partial updates.

Postbacks will be just like normal as a normal page . If you are loading dynamically some times you have to handle those accordingly. The only limitation is if you want to share it across the applications it cannot be done as we do with custom controls.

You can check the below link which gives an idea about the lifecycle usercontrols and also order of the usercontrol control events fire .
http://blogs.thesitedoctor.co.uk/tim/2006/06/30/Complete+Lifecycle+Of+An+ASPNet+Page+And+Controls.aspx[^]

Hope this helps
 
Share this answer
 
v2

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