| 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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 26, 2012, 9:46 AM
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.
SenthilkumarPosted Mar 26, 2012, 7:12 AM
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?
VulpesPosted Mar 26, 2012, 5:45 AM
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx
SenthilkumarPosted Mar 25, 2012, 11:51 PM
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
VulpesPosted Mar 25, 2012, 12:10 PM