Best practice for custom control that can switch between objects derived from the same base class
I currently work for a company that has a WebUI for our product. At some point a class was made to draw differant kinds of graphs. This class had an ENUM that switched between the differant types(Bar, line, pie, etc). To me it seems like it would be better to make an Abstract base class and a differant class for each of the types rather then using a switch, however, this would require us to change ALL of the pages to hide and show differant controls based on the selected bar type.
What is typically the best practice for this kind of a situation, I had the idea of creating a prox...
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 ...
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...
Problem Extending Class in Class Library project with WebConrol class for creating Custom Server Control.
I want to create a custim sevrer control. When I add a class and place it in the BIN directen I add a am able to extend the class with either the Control or WebControl class. But when I add a ClassLibrary project to my ASP.NET project, then I am not able to extend the class with either the Control or WebControl class. I am not able to use the System.Web.UI.WebControls.
How to extend the the Class Library project class with either the Control or WebControl class?-----------------------------------------------Please click Mark as Answer if this helped.
in your class library p...
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 Par...
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...
Creating Custom Web Controls that Inherit from a Custom Base Class
Hi there,I have some existencial doubts, and hopefully someone can help me out with what I want to achieve.I need to create several custom web controls that share some common properties and methods. In nature, they are basically extensions to existing web controls like TextBox, DropDownList, etc., but with some extre properties: Options and Defaults. Basically what I need to do is to be able to handle this custom web controls in this way:
foreach(CustomBaseControl bc in ControlCollection)
{
bc.Options = yada yada;
bc. Defaults = yada yada;
} I don't want to go thr...
Creating .Net custom server controls and .Net pages programatically
Thanks a lot for reading this and greatly appreciate your inputs
I am writing a webinterface that lets users configure options that'll create an interface for them and generete the webpage. So I am having to programattically create custom server controls and .Net page with code behind to support the functionality.
Are there APIs in the .NET SDK that let you do this. Any pointers would be greatly helpful
Thanks a lot
Sathya
Controls on the fly? Or Create code on the fly? I think it is the latter so here we go - look at the following namespaces:
* System.Reflection.Emit - gen...
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....
How can one call a custom server control DLL like a custom class library DLL
All --
How can one call a custom server control DLL like a custom class library DLL?
Please help.
I think that I am missing something simple? Or, maybe I am trying to do something impossible? Or, maybe something else?
I have a custom server control DLL that I built, with a UI, etc, called...
(A).
App_Web_teamthemeselectorwebcontrol.ascx.cdcab7d2.dll
...and it works fine.
I register my custom server control DLL on an ASPX page like this...
(B).
<%@ register tagprefix="team" namespace="Team.WebControls" assembly="App_Web_teamthemeselectorwebcontrol.a...
Custom Server Controls and SiteMap class
I have a custom control in which I am using the SiteMap class to build a menu. It runs perfectly and outputs exactly what I would expect.
However, when I drag my control from the Toolbox into VS2005 Design View, I receive the error: The provider 'AspNetXmlSiteMapProvider' specified for thedefaultProvider does not exist in the providers collection."
When I place code into my control to output the name of the provider being used, it outputs "AspNetXmlSiteMapProvider" and the control still works, so it is obviously finding the correct SiteMapProvider.
Anybody have any ...
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...
Deriving a control from a base class declared MustInherit
I've heard this problem discussed before :
http://www.dotnet247.com/247reference/msgs/29/146830.aspx
basically i have a base class
##################
code
##################
Public MustInherit Class ControlBase
Inherits System.Web.UI.UserControl
End Class
##################
And i try to derive my user control from it:
##################
code
##################
Public Class Control
Inherits ControlBase
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Dia...
Building .NET Custom Server Controls and distribution
Can anyone tell me the best practice for distributing custom controls or controls that have been developed from inheriting server controls?
I am curious how other companies support a custom library of objects developed by developers within an enterprise.
At my company we follow the naming standards put forth by Microsoft: CompanyName.AppName.LayerName
Example:
Say I developed a Drop Down List that is used to display every year from 2004 to DateTime.Now in ascending order from inheriting the Web Server Control Drop Down List. After a committee of other developers have tested and app...