Last post Apr 21, 2008 03:53 PM by johnywhy
Jan 17, 2008 07:56 AM|radco|LINK
Hi, I want to create a dll file with WebUserControl (ascx and cs file). Can I? I don`t see a template for it.
If I can not, is there other way to achieve this goal?
Jan 17, 2008 09:02 AM|adyle|LINK
What you might be looking for is a Web Control Library. This will allow you to build a project of custom web controls that you can compile into a dll and then use in any project. Start a new porject and select Visual C# > Windows > Web Control Library. Then
in the project you can add new Web Custom Controls.
Below are a couple of links to get you started:
Jan 17, 2008 01:03 PM|radco|LINK
Well it is true, what you have written, but you didn`t understand my problem. I can create a new control by deriving from existing (using a file with cs extension) in that kind of project. The problem is that in this way I need to override RenderContent
method and create a result using code. I would like to create a .ascx file and there I want to use Design mode (it is easier and much faster when I see the result than if I need to concat strings to make the same)
Jan 18, 2008 07:44 AM|adyle|LINK
It's my understanding that you can't do that. If you want to create a class library to distribute as a dll, you need to create custom server controls that override the base webcontrol classes. But, I could be wrong. It's been known to happen.
Jan 18, 2008 08:06 AM|radco|LINK
You are right, I was searching two hours on msdn and I found an article where user and custom controls were compared
Apr 21, 2008 03:53 PM|johnywhy|LINK
you might both be wrong:
"Turning an .ascx User Control into a Redistributable Custom Control"
I'm hoping it will be possible to resolve that issue using the following embedding method:
Embedding Resources in ASP.NET 2.0 Assemblies
I have not tried it, maybe someone with free time could try it, and post their results here?...