Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create Engineering Library by ASP.NET

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "ASP.NET how to create an engineering library", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "ASP.NET how to create an engineering library" bar!

Learn to create engineering libraries and apply them to your own projects

ASP.NET component design learning to create an engineering library 1. Start VS200X

ASP.NET component design learning to create an engineering library 2. Select a new solution

ASP.NET component design learning to create the engineering library 3, select the default scheme type, select the Web control library. The Web control library does not need a web site and is basically a DLL type library.

ASP.NET component design learning to create engineering library 4, enter the name of your own type library, such as ASPCTLLib and so on. This determines that namespace and other future projects will use the reference library name of this library.

ASP.NET component design learning to create the engineering library 5, the system automatically generated code is as follows:

Summary description of using System; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; namespace ASPCtlLib {/ / < summary > / WebCustomControl1. / / < / summary > [DefaultProperty ("Text"), ToolboxData ("< {0}: WebCustomControl1 runat=server > < / {0}: WebCustomControl1 >")] public class WebCustomControl1: System.Web.UI.WebControls.WebControl {private string text [Bindable (true), Category ("Appearance"), DefaultValue ("")] public string Text {get {return text } set {text = value;}} / / < summary > / renders this control to the specified output parameter. / / < / summary > / / < param name= "output" > HTML writer to write to < / param > protected override void Render (HtmlTextWriter output) {output.Write (Text);}

Creation of Engineering Library for ASP.NET component Design Learning 6. Introduction of AssemblyInfo.cs

ASP.NET component design learning to create the engineering library 7. Compile this project to get ASPCTLLIb.dll

ASP.NET component design learning to create an engineering library 8. Other project references

How to reference the Web control library established by yourself

1. Open / create a new asp.net project

2. Refer to ASPCTLLib.dll, and aspctllib will appear in the reference, and copy the previous dll file to the directory of the current project.

3. Add the controls in your Web control library to the tabs of toolbar: right-click the tab, customize the toolbox, select. Net framework components, browse, find aspctllib.dll to join, and you can see that the component named WebCustomControl1 exists in the toolbox.

4. Open your own aps.net web project and select a web form, and you can add your own controls to it. By default, this control displays: [WebCustomControl1 "WebCustomControl1"] at design time.

5, select this control in the form, open the properties for editing, basically the default design control has only one Text property that belongs to the custom property, enter specific text.

6. Compile and browse to see the effect.

Thank you for reading, the above is the content of "how to create an engineering library in ASP.NET". After the study of this article, I believe you have a deeper understanding of how to create an engineering library in ASP.NET, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report