Custom Server Control Vs Web Parts, Any need for Custom Server Control

Hello

I've just posted a similar question on why you need server controls when you can pre-compile usercontrols and redistribute them.

http://forums.asp.net/p/1397433/3010100.aspx#3010100

I've seen lots of (usercontrol vs web part) but not much on web part vs custom server control.

According to the MSDN site you can put web parts onto a normal asp.net page outside of a web part zone and they behave just like custom server controls. So, if you are creating a bunch of controls for redistribution to customer asp.net sites and/or SharePoint sites why don't you just create Web Parts?

This way you get normal server control behaviour when in an asp.net site and can make use of the web part framework when in a web part type page (e.g. SharePoint).

Cheers

G

0
grazza98
3/16/2009 12:46:37 PM
📁 asp.net.custom-server-controls
📃 3498 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 1662 Views

Hi,

WebPart itself is a built-in web control. Comparing it with custom control is just like comparing Panel control with custom control (actually WebPart derives from Part and Part derives from Panel), which doesn't make much sense, I think.

When writing custom control we're free to write a class deriving from an existing built-in control. So of course it can derive from WebPart control.


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
3/18/2009 1:34:33 AM
Reply: