We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

access level for server control and user control

Thread ID:





41361 Feb 28,2006 01:35 PM UTC Mar 1,2006 09:01 AM UTC ASP.NET Web Forms (Classic) 2
Tags: FAQ
Asked On February 28, 2006 01:35 PM UTC

When we drag and drop any server control from toolbox to web form, the relevant control is added to code-behind automatically with access level to be protected. When we drag and drop a user control to a web form, if we want to use that user control in code-behind, then we need to declare it to be protected as well, otherwise it will not work properly, why??? I never pay attention to this untill I start to work with user control. Thanks zhuang

Administrator [Syncfusion]
Replied On February 28, 2006 03:32 PM UTC

Hi, A nice question, I think the reason should be because "just a guess only" The controls are just reusable classes(the benefit of object oriented concept), and ofcourse the full usage of object oriented features are applied in reusable classes only. So we are in need of a object to refer this classes. But why do we need protected? still confuses but this should be again regarding the protection level is intermediate I guess because if any one wants to use it inside the application or page , they can use the control and the chances of breaking the control outside the application should be avoided , so finally that too makes sense i guess , being protected. If any one have a nice Blogs/discussion on this please post. -Hari

Replied On March 1, 2006 09:01 AM UTC

Thanks, I have posted the same question on other forums, I will keep this post updated once new answers come in.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon