We put the prepared ASP. after the Net Server Control is dragged to the web page, it will find that the actual running effect can be displayed in the design status, indicating that the system will automatically call some functions in the design status, including createchildcontrols.
But if there is a problem at this time, how should we debug it? Press F5 directly, and the system will prompt "the project with Class Library output type cannot be started directly". This requires some tips.
1. Open the solution where the control library is located, because we will open a solution later, which is called a solution.
2. Set the control library in Solution A as the startup project and set the breakpoint where the status needs to be debugged. In this example, we set a breakpoint in the createchildcontrols function.
3. Open the properties page of the control library in Solution A. On the debug sub-page, modify the startup operation. The default setting is to start the project.ProgramSelect devenv.exe as the external program. This program is pulled by the main program of vs2005. It is usually "C: \ Program Files \ Microsoft Visual Studio 8 \ common7 \ ide \ devenv.exe" in a directory similar to the following ".
4. Press F5 to start debugging, and a new vs2005 environment will be automatically opened. The solution we opened in the new environment is called B.
5. Find the page on which the control is placed in solution B and switch from the source view to the design view. If no, the breakpoint of solution a takes effect.
6. ASP. NET custom server controls can be debugged in a similar way when they are designed. The trick is to open two development environments and use one to debug the other.