Inherit Web Custom Control
Posted on 2005-04-22
I have a custom control that I purchased. Everytime they come out with a new version, I have to recompile the project. This is VERY annoying.
I was thinking if I created my own custom control that inherited from their custom control, I would then be able to just link my projects with my custom control, and then when new versions are released, just recompile my custom control. I would also have the added benefit of overriding their control and be able to change the behavior of the control my adjusting my custom control.
I started out by creating my own web custom control library. I then added the reference of the control that I bought to my custom control libary. I then added a custom control and changed the class so that it is derived from their custom control. Finally, I added a web-based project to the solution and attempted to add my library as a reference and then place the custom control on the web page. Here is my inherited class:
public class MyWebCombo : ISNet.WebUI.WebCombo.WebCombo
My first problem is that the program wants me to add a reference to the original DLL. I don't want to do this. How I can setup this control do that I can just compile with my custom control libary?
Secondly, just for the purposes of trying to get this to work, I added the reference as the compiler suggested (even though I do not want to do this). The project compiles, but I cannot the web page to load the custom control. I get the error "Could not load type WebControlLibrary1.WebCustomControl1 from assembly WebControlLibrary1, Version 1.0.x.x, Culture=neutral, PublicTokenKey=null". The DLL is being copied to the bin directory of the web page project.
Anyone who can tell me how to do this would be greatly appreciated. I will need step by step instructions because I've never created a custom control before.