System.Web.UI.HtmlControls

Source: Internet
Author: User

Used to create a label. HtmlContainerControl generally use this class to create new labels.

Maybe we are familiar with System.Web.UI.WebControls; space. System. The Web.UI.WebControls namespace contains classes that allow you to create Web server controls on a Web page.

The most common is when you need to get each data when you use a data-bound control

When binding data:

Get this data in the background:

More go to mdsn inside to see it

Similar to this control is the System.Web.UI.HtmlControls namespace. The System.Web.UI.HtmlControls namespace contains classes that allow you to create HTML server controls on Web forms pages. One is a server-side control, one is an HTML control.

For example:

We create labels at the front desk.

           varNewu = Document.createelement ("u"); //Create element newu.innerhtml="Custom Add"+ (parseint (Count) +1)+":";  //Set Text newdd.appendchild (NEWU); //Add this tab to the seat varNewspan = Document.createelement ("span"); varNewinput = Document.createelement ("input"); Newinput.setattribute ("placeholder","fill in the class capacity ..."); //Set properties, which can be used within the label Newinput.setattribute ("type","text"); Newinput.setattribute ("ID","txtlable"+Count); Newinput.setattribute ("name","txtlable"+ Count);

Create a label in the background

HtmlGenericControl div =NewHtmlGenericControl ("Div");//creating a tag base class requires writing the required type in the constructorDiv. Attributes.Add ("ID","1");//Setting PropertiesDiv. InnerHtml ="Test Text";//textHtmlInputText Test=NewHtmlInputText ("text");//strongly typedTest. Value ="Test 2"; Test.id="123"; Test. Name="456"; //This property is not valid div.                   Controls.Add (test); Page.Controls.Add (div);//Add the seat on the page

System.Web.UI.HtmlControls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.