| Custom Controls are derived from which of the classes |
| a) System.Web.UI.Webcontrol |
| b) System.Web.UI.Customcontrol |
| c) System.Web.UI.Customcontrols.Webcontrol |
| tell me the answer |
Loading
| Custom Controls are derived from which of the classes |
| a) System.Web.UI.Webcontrol |
| b) System.Web.UI.Customcontrol |
| c) System.Web.UI.Customcontrols.Webcontrol |
| tell me the answer |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 25, 2012, 8:10 AM EDT
SenthilkumarRank #387 · 6.5K reputationPosted Mar 25, 2012, 7:51 PM EDT
There is no namespace with the CustomControl or CustomControls.WebControls.
The custom controls are nothing but, we need to develop our controls on top of the existing ASP.Net web controls.
For example we have lot of controls like TextBox, Button.
If you have a requirement like TextBox should only accept the number then you need to develop your own custom controls.
The every control has its own class, so the custom control class has to be overriden that properties and events.
using System.Web.UI.WebControls
namespace MycustomControls
{
public class TextBoxNumber : TextBox
{
//Write you logic here to implement custom textbox.
}
}
You can get some example custom control in the following link:
http://sumedha7.blogspot.com/2008/07/derived-custom-controls-in-aspnet-20.html
VulpesRank #55 · 29.2K reputationPosted Mar 26, 2012, 1:45 AM EDT
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx
SenthilkumarRank #387 · 6.5K reputationPosted Mar 26, 2012, 3:12 AM EDT
I agree that.
But if you see the namespace
System.Web.UI.WebControls and inside that there is no WebControl class.
If you check the TextBox hierarchy, shows like System.Web.UI.WebControls.TextBox
Can you clarify me on this?
VulpesRank #55 · 29.2K reputationPosted Mar 26, 2012, 5:46 AM EDT
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.aspx
This is just the base class for other controls in this namespace such as TextBox:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspx
In practice, of course, you'd probably derive your custom control from TextBox, Button, Label etc rather than directly from WebControl though the latter would still be the ultimate base class of your custom control as well as its parent.