为你而来

aspnet企业级开发:html服务器控件的属性

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Web;
 5 using System.Web.UI;
 6 using System.Web.UI.WebControls;
 7 
 8 public partial class _3_3 : System.Web.UI.Page
 9 {
10     protected void Page_Load(object sender, EventArgs e)
11     {
12         Text1.Style.Add("border","solid 1px green");
13         Text1.Attributes.Add("value","FLEX");
14         /*通过这两个集合,都可以在C#代码中,赋一些html标签的属性
15         当然从工具箱托下来的<input type='text'....要加上runat='server'属性
16         才可以在这里Text1引用
17         */
18     }
19 }

 

posted on 2012-09-15 22:04  为你而来  阅读(154)  评论(0编辑  收藏  举报

导航