Last post Apr 27, 2011 09:18 AM by Careed
Apr 24, 2011 10:04 PM|MrProgrammer|LINK
I want to develop custom web server control in visual studio 2005,
When i open new project and start it, i cannot reach to Design View inside the project to add controls from ToolBox
WebControlLibrary1 class only.
What is the poblem please
Apr 24, 2011 10:48 PM|Careed|LINK
There is no problem. When creating a custom server control, you will need to use all code since this is essentially a class. There is no designer involved in creating a custom server control. Additionally, you would typically not add other controls unless
you are building a composite control.
Now, if you want to create a user control, then you would be able to use the designer for this. Is this what you really looking to build?
Apr 26, 2011 01:44 AM|MrProgrammer|LINK
In fact, i have a dream that i want to make custom control that display the UserName when user signed in to the website,
and when user click on it, menu dropdown and show links like: Inbox,Account,My Bookmarks,...... ect.
Like that custom control on www.youtube.com and many other websites.
can u help me man or tell me about article explain how to do this project please.
Apr 26, 2011 09:24 AM|perper|LINK
check out this articles
hope this helps
Apr 26, 2011 09:04 PM|Decker Dong - MSFT|LINK
It seems that you've mixed the concepts of Developing Server-side control with the template in the VS and customized control (*.asx).
Generally speaking. A Server-side control is very normal, which can be published and added into the ToolBox. It has no design view for you to develop by "dragging and dropping" so easily. You have to handle proper events as well as to write down
codes and then compile the control, and then you should apply it by dragging and dropping into the aspx page. Thus you can see what it looks like. (This is a torturial：http://msdn.microsoft.com/en-us/library/zt27tfhy.aspx)
Here's the template:
Compares with this, a customized control is much easier, it is based on an existing project, you can right click the proj and add "Web User Control" into the proj, and then you can switch between design mode and code mode to view, to see what's happening
when coding. And you can drag and drop the control into the existing page to test it to see the result.
Apr 27, 2011 09:18 AM|Careed|LINK
While I sounds like that you're looking for a web user control, which can be developed just like a web page, you are probably wanting a custom server control. The distinction between them is that the user control is created using an ASCX file with code-behind
while a custom server control is strictly code contained in a class library. The benefit of the server control is that it is more portable than the user control as the server control's library can be compiled independent of any specific application and then
added to a number of different projects.
So, what type of control are you actually looking for?