After five months of work, I came to a small company and brought me some old birds, but not my company. I only came here for a few weeks. The first project that came to the company was a web project. There were a lot of repeated code in it, and the page code was the same. You are too watery. There are so many junk code, people are despised. People always need to be stabbed once or twice before moving forward. The same is true for falling in love. People will wake up after being hurt.
My ultimate goal is to complete the DropDownCheckList control. DropDwonList can only be single-choice, and this control can have multiple effects. I believe there are many examples on the Internet. Although the time for writing code has passed, but I still want to write more code and learn more. This article records the details that I learned step by step.
1. create a new class library named XYB. controls, XYB is the abbreviation of my real name. In this class library, add a class named TextEdit and create a new Web application named XYB. UI, in XYB. add a page in the UI named TextEditUI. aspx
2. Import the namespace
System.ComponentModel;
System.Web.UI.HtmlControls;
3. Inheritance
Since Control development is a Web Control, the WebControl class must be inherited. The namespace of this class is System. Web. UI. WebControls, and WebControl inherits Control.
The TextBox Control inherits WebControl and has all the features of TextBox.
System.ComponentModel;
Generate a new one, and a TextEdit control will be displayed in the toolbar. If not, add the control following the steps below.
1. right-click a blank area under the toolbar --> Add tab, and name it XYB. the Controls component is named at will and then created in XYB. right-click a blank position in the "Controls" group of the "Controls" component and choose "select item"> browse to find XYB. controls. dll class library, add it in, so there is an additional TextEdit control in the toolbar
AutoEventWireup = CodeBehind = Inherits = %> <% @ Register Assembly = Namespace = TagPrefix = %> <! DOCTYPE html PUBLIC>
- Prediction of the next set:
Custom TagPrefix tags. Stay tuned to me!