User controls and custom controls
2005-03-24 02:20
330 查看
User controls are easy to make, but they can be less convenient to use in advanced scenatios. You can develop user controls almost exactly the same way that you develop web forms pages. Like Web Forms, user controls can be created in the visual designer, they can be written with code separated from the HTML, and they can handle execution events.
However, because user controls are compiled gynamically at run time, they cannot be added to the Toolbox, and they are presented by a simple placeholder when it is added to a page. This makes user controls harder to use if youu are accustomed to full Visual Studio.NET design-time support, including the properties window and Designview previews. Also, the only wat to share the user control between applications is to put a seperate copy in each application, which takes more maintenance if you make changes to the control.
Custom controls are compiled code, which makes them easier to use but more difficult to create; customer controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and display it in a visual designer with full properties window support and all the other design-time feature of ASP.NET server controls.
In addition, you can install a single copt of the custom control in the global assembly cache and share it between applications, which makes maintenance easier.
However, because user controls are compiled gynamically at run time, they cannot be added to the Toolbox, and they are presented by a simple placeholder when it is added to a page. This makes user controls harder to use if youu are accustomed to full Visual Studio.NET design-time support, including the properties window and Designview previews. Also, the only wat to share the user control between applications is to put a seperate copy in each application, which takes more maintenance if you make changes to the control.
Custom controls are compiled code, which makes them easier to use but more difficult to create; customer controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and display it in a visual designer with full properties window support and all the other design-time feature of ASP.NET server controls.
In addition, you can install a single copt of the custom control in the global assembly cache and share it between applications, which makes maintenance easier.
相关文章推荐
- 40、XAML user and custom controls
- Custom Controls and User Controls
- Custom Controls and User Controls
- ASP.NET User Controls and Custom Server Controls
- Embedding and retrieving resources in custom controls
- WinForms Controls > Examples > How to: Add New XtraForm, RibbonForm and XtraUserControl to Your Proj
- Pro .NET 2.0 Windows Forms and Custom Controls in C#
- Developing SharePoint WebParts using User Controls and Web Applications
- Windows Controls and WPF UserControls inside an XNA Game Project
- Building a WPF Sudoku Game: Part 4 - Building a Least Privilege Plug-in System and Even More Custom Controls (zz)
- Creating and Using custom controlsin VC++
- Q&A: What's the difference between CustomControl and UserControl?
- 对 Web user controls 和 Web custom controls 的一些建议
- Professional Web Parts and Custom Controls with ASP.NET 2.0
- Packaging ASP.NET User Controls into an Assembly and Reuse it Multiple Projects
- Web user controls 和 Web custom controls
- 学习custom control and usercontrol
- Building a WPF Sudoku Game: Part 4 - Building a Least Privilege Plug-in System and Even More Custom Controls
- [web referrence] Sequence that events are raised for Pages, UserControls, MasterPages and HttpModules
- Core - Provide an easy way to store administrator and user model differences in a custom store (e.g., in a database)