Control versus WebControl

S

shapper

Hello,

I am creating a Generic.List(Of ...) to hold a few controls.

What is the difference between Control and WebControl in Asp.Net?
Which one should I use?

Thanks,

Miguel
 
C

caffienerush

Hello,

I am creating a Generic.List(Of ...) to hold a few controls.

What is the difference between Control and WebControl in Asp.Net?
Which one should I use?

Thanks,

Miguel

All asp server controls (like TextBox) inherits directly or indirectly
from WebControl and WebControl inherits from Control.
All html server controls (like HtmlInputText) inherits directly or
indirectly from HtmlControl and HtmlControl inherits from Control.

I would use WebControl if I was only using asp server controls but use
Control if I was dealing with html server controls as well.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top