Start-" Program-Microsoft Visual Studio 2005-Visual Studio Tools-Visual Studio 2005 Command Prompt
Then enter your class directory. For example, your class file is under E:/test/app_code,
Run the following command:
CSC/Target: library file. CS
File. CS is your class file.
Then you can generate a DLL file with the same name !!!
Custom server controls are divided into two types:
1. One is to use *. aspxCodeAnd *. CS code is compiled to generate DLL, and then add reference to toolbox for use.
It is generally used in webform.
2. Another method is to use only *. CS, compile the DLL, and add it to the toolbox.
It is generally used in winform.
To generate a custom control, follow these steps:
For example:
1. Drag a button from the designer to the page,
Set a fixed value for the button size, color, or text. Save the file name as a. CS.
2. CSC/R: system. dll/T: Library/out:... \ .. \ A. dll A. CS
3. Right-click the blank area in the toolbox, right-click the menu, and select "add remove item ".
Add it to the toolbox. In this way, you can drag and use it like a normal button.