all groups > asp.net building controls > october 2005 >
You're in the

asp.net building controls

group:

ASP.NET 2 and custom controls!! How can i create them?


ASP.NET 2 and custom controls!! How can i create them? smash2004 NO[at]SPAM gmail.com
10/30/2005 12:31:34 AM
asp.net building controls: i can't find anything on the net to create a simple custom control with
asp.net 2 and use it in other project..with that i mean having my own
custom control on toolbox to drag it in designtime

in asp.net 1 that was simple...i just built my project and there was
dll which i importet in my tab in toolbox...but in asp.net 2 there are
is no dll generated when i build my project so i can't import
anything...

are there any good tutorials on this, but it has to be ASP.NET 2!!!

or maybe someone can explain me this with a very simple example...

thx in advance
Re: ASP.NET 2 and custom controls!! How can i create them? Riki
10/31/2005 9:03:33 PM
[quoted text, click to view]

I guess you're using Visual Web Developer 2005 Express?
In that case, you can't create custom controls with it. You need
Visual Studio 2005. You could also compile your files manually
into a dll with csc or vbc.

Create a batch file "build.bat", with content like this:

SET source=myfile1.vb myfile2.vb
SET target=bin\mydll.dll
SET
assemblies=system.web.dll,system.dll,system.xml.dll,system.design.dll,system.drawing.dll
SET compiler=%WINDIR%/Microsoft.NET/Framework/v2.0.50215
SET res1=.\mybitmap.bmp,mynamespace.mybitmap.bmp
SET res2=.\myresource.resx
%compiler%\vbc /t:library /out:%target% /r:%assemblies% %source% /res:%res1%
/res:%res2% /nowarn
pause

Replace vbc with csc if you use C#, and replace 2.0.50215 with the correct
version number.

--

Riki

AddThis Social Bookmark Button