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. Follow

1 Replies
1471 Views

Similar Articles

[PageSpeed] 19

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:

Similar Artilces:

Usercontrol vs Custom Server Controls, Any need for Custom Server Controls
Hello I'm new to ASP.Net so this is probably a stupid question but, is there any need to create customer server controls now that you can pre-compile usercontrols into a dll and thus easily share between applications? This blog post from David Ebb describes how to do it and the restrictions he note don't seem that bad (other than being able to embed resources such as images in the dll). http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx His article desribes the techniques for ASP.Net 2.0 and he suggests that there will be further improvements in .Net 3.5 in this ar...

problems listenening to events on a custom server control from another custom server control
 Hi all,I am having problems listening to events on one of custom server controls(AddBookmark) from another custom server control(BookmarkList). The listener or the BookmarkList control has a property that can be set to the AddBookmark control (string at design but the reference is obtained at run-time). I am able to get a reference to the AddBookmark control and add a listener to it on the BookmarkList control on the OnPrender of BookmarkList. But the problem is that when the events on AddBookmark gets fired, the listener added from the BookmarkList is no longer present and the listene...

Custom Server Control Made of Custom Controls?
I'm giving myself a crash course in custom server controls, and I have a quick general question. Can I have a custom server control that is composed of other server controls I created. I'm pretty sure the answer is yes, but I want to be positive. Yes http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondevelopingcompositecontrols.asp Shows how to combine existing controls into a new control using class composition. -ron Thanks! ASP.NET so rocks! Making page components extensible objects is such a great idea! I love it....

Server Web User Control or Web Custom Control
Ok, I made a DataGrid I like, stuck it in a Web Control Lib, and then to my toolbar. Now I want to take my nice little control and add it to a greater control, maybe place some buttons around it etc. I could always inherit from it in a new custom control and dynamically add the buttons, but I thought about using a Web User Control. I thought I could easily create a Web User Control, drop on my grid and the buttons on a form, and expose some properties and events, but once I got into it, I got a feeling that this isn't what a Web User Control is for. When designing a control li...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Web Custom Control within a Web Custom Control
I was wondering if this can be done and how. I've created a simple custom control that displays a header which is my first custom control. So I'm just a baby when it comes to this.. Within the header I currently have a property for breadcrumbs which is a string. What I would like to do is have the breadcrumb property  be a Link Button List. I did find a custom control of a Link Button List which is exactly what I wanted. My question is how can/do  I include this into my custom control? Can it done? How? Please help? I'm at a lose here.   Susan You should be able to do ...

Custom Events in Custom Server Control
 Hi There I've created a custom server control. I have extended it by adding my own event which fires in one of the aggregated control's event handlers. My probelms is that I would like to be able to specify the event handler for the event from the aspx file as a tag attribute.Does anyone know how to link the attribute of a customer server control tag in the aspx file to a custom event in the class source for the control?   I've done this several times with Custom Controls.  All I do is declare the event in the CustomControl's class public...

Custom Server Control With Child Control
All, I am currently putting together a very simple control. The new control outputs a table with two rows. The top row contains a heading and the bottom row will contain any other content. The control as it stands works perfectly well and I can place text into the content row no problem. Now, to the problem. Once I'd completed the control I figured it would be neat to enable the developer to add controls directly into the bottom row (content row) of the outputted table. As you probably know the WebControl class has a Controls collection which the developer can use to add any other...

Custom event for Custom server control
  Hi All, I have a custom server control (Multi selection drop downlist). This control contains AspxEditButton control(which is like textbox with button), check box list control and panel.I have to display all selected values in AspxEditButton at control is leaving that panel. How can i create LostFocus event for panel . Please anyone help meRegards, Anu All I can think of, is that there is a javascript "onblur" you could look into, maybe you could use some AJAX techniques to make that JavaScript event fire a server side ev...

Custom Server Control with Child Controls
I have a custom server control <xx.Parent... /> which parses custom child controls <xx.Child... />. In Visual Studio 2008, IntelliSense shows me both when I start typing my control namespace. How can I prevent the child control from showing up in IntelliSense  unless I'm adding it within the parent tags?Thanks. --Rudy...

Custom Server Control - Moving within the VS.Net Designer
Hi, I have created a custom server control that inherits from System.Web.UI.Control. I would like my end users to be able to drag and move the server control in the VS.Net IDE. I presume I have to expose the left/top style properties but can't find anything in the documentation or via google. Any pointers, links or code would be great :) R Hmmm, Inherit from System.Web.UI.WebControls.WebControl or just use the default Create Web Control project in the .Net IDE Can't believe I spent 1 hour looking for this :) Any element can be movable in VS.NET. What it really does is ...

HTML Server Control or Web Server Control?
Hi, Being new to ASP.NET I have one thing confusing me much. 1. Whats the major difference between HTML Server Control and Web Server Control? 2. Whats the advantage of processing all the HTML Controls in Server? Server will not be overloaded with this? Which one should I use?..Plain HTML or HTML Server Control or Web Server Control? Thanks and Regards _________________ ASP 2 ASP.NET FYI: http://msdn.microsoft.com/msdnmag/issues/01/09/asp/toc.asp Colt Hi Colt, Thanks for the link. I personally prefer server controls - - there are so many more possi...

html server controls and web server controls
hello what is the difference between html server controls and web server controls? what is the main goal of converting html elements to html server controls , so why i can directly use the web server controls instead of converting process? thank you for the help and for the time If you convert a normal html control to a html server control then you can work with and reference it programmatically. MS advises using web controls where possible. But if your application uses vast amounts of html controls its far easier to just apply runat="server" than to re invent them a...

Custom Web Control inside another Custom Web Control
Hi I created a custom web control (CusWebNew) that displays some textboxes by adding them to the ControlCollection of the webcontrol. I also created a custom webcontrol (CustWebButton) that inherts from Button control, and overrided the OnClick function. When I use CustWebButton on a regular web form, it seems to function correctly. However, when I added to be part of the ControlCollection of CustWebNew, it stops to work.   Any ideas why? Thanks Hey, What do you mean by stops to work?  Explain what you are trying to do with it and what it doesn't do.Brian"Trust in the...

Web resources about - Custom Server Control Vs Web Parts, Any need for Custom Server Control - asp.net.custom-server-controls

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Venezuela's Opposition Wins Control of Legislature - Al Jazeera America
... celebrate the closing of a polling station during legislative elections in Caracas, Venezuela, Dec. 6, 2015. The opposition won control of the ...

The ACLU backs using the terror watch list for gun control, but only “with major reform”
... did say, through a spokesperson, that the watch list would need “major reforms” in order to be used as an effective tool for gun control and ...

With gun control off-limits, politicians want tech sector to fight terror
... very next day, the Senate voted against a measure that would have barred gun sales to people on federal terror watchlists. Another gun-control ...

Obama calls for better gun control, and for tech companies to help fight terrorism
President Barack Obama all but called out encryption in a 15-minute Address to the Nation speech on Sunday night. The President touched on various ...

Obama speaks on ISIS, gun control, tolerance in Oval Office address - Videos - CBS News
In a primetime speech Sunday night, President Obama said the terror attack in San Bernardino, California, shows terrorism is now in a new phase. ...

Sugr Cube is a Sweet Spotify Speaker with Touch & Motion Control
... goodies, like Spotify Connect, Pandora, and, eventually, Air Play integration. Sugr also had a little bit of fun with volume and track controls ...

Windows 10 vs. OS X: Which gives sys admins more control?
Nearly everything can be managed as if it were a mobile device, using APIs at the operating system for assured reach and consistent implementation ...

NV's Fiore: 'That 5 Year Old Grandson Of Mine Has Total Trigger Control'
It's very likely you've seen Michele Fiore's family Christmas photo by now, it's been all the rage at Idiocracy viewing parties everywhere. If ...

The Solution Isn’t As Simple As Gun Control
... latest column over at the Daily Beast details how, in the wake of the San Bernardino shootings, Democrats were quick to pounce on the gun control ...

Resources last updated: 12/9/2015 12:25:08 AM