随笔分类 - VS2005 控件
站点导航控件TreeView
摘要:
1、TreeView 服务器控件的事件
TreeNodeCheckChange 当TreeView服务器控件的复选框在向服务器的两次发送过程之间有所更改时发生
SelectedNodeChange 当选择TreeView服务器控件中的节点时发生
TreeNodeExpanded 当展开TreeView服务器控件中的节点时发生
TreeNodeCollapsed 当折叠TreeView服务器控件中的节点时发生
TreeNodePoulate 当其PopulateOnDemand属性设置为true的节点在TreeView服务器控件中展开时发生reeView
TreeNOdeDataBound 当数据项绑定到TreeView服务器控件中的节点时
阅读全文
母版页
摘要:public partial class 母版页_Default : System.Web.UI.Page { protected void Page_PreInit(object sender, EventArgs e) //在内容页和母版页合并之前运行的事件 { if (Session["aa"] != null) //虚判断 { ...
阅读全文
GridView2
摘要:1、镶套(在GridView里镶套BulletedList) private SqlDataReader read(string id) { SqlConnection mycon = new SqlConnection(ConfigurationManager.ConnectionStrings["pubconn"].ToString()); m...
阅读全文
GridView
摘要:public partial class GridView_GridView3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { for (int i = 1; i < GridVie...
阅读全文
控件添加 - 项、刷性
摘要:1、PlaceHolder ph.Controls.Add(hl); 添加控件 2、控件,对象添加自定义属性 Button1.Attributes.Add("onmouseover", "this.styl.backgroundColor='#00ffcc'"); e.Row.Attributes.Add("onmouseover", "...
阅读全文
DataList
摘要:1、数据绑定(将数据写成一个方法,方便数据绑定) public class db { protected string connstring; private int pagesize; public db() { connstring = ConfigurationManager.ConnectionStrings["pubconn"].Conne...
阅读全文
table-表格
摘要:动态建立表格 protected void Button1_Click(object sender, EventArgs e) { int r = int.Parse(DropDownList1.SelectedValue); int c = int.Parse(DropDownList2.SelectedValue); fo...
阅读全文
Panel--容器
摘要:protected void Button1_Click(object sender, EventArgs e) { int a = int.Parse(DropDownList1.SelectedValue); for (int i = 1; i "; Panel1.Controls.Add(lb); } ...
阅读全文
MultiView
摘要:protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { MultiView1.ActiveViewIndex = Convert.ToInt32(DropDownList1.SelectedValue)-1; } ...
阅读全文
Literal 控件 Mode:Transform,PassThrough,Encode
摘要:Transform: [fdsf](desf);"hahah" PassThrough: [fdsf](desf);"hahah" Encode: [fdsf](desf);"hahah" Lable1: [fdsf](desf);"hahah" Lable2: Server.HtmlEncode [fdsf](desf);"hahah"
阅读全文
FileUpdate--上传控件
摘要:protected void Button1_Click(object sender, EventArgs e) { string name = FileUpload1.FileName; //上传文件名 string size = FileUpload1.PostedFile.ContentLength.ToString(); //文件大小(字节)...
阅读全文
DropDownList--下拉菜单
摘要:1、ArrayList数据列表(使用数据列表必须引入using System.Collections命名空间) protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ArrayList arrl = new ArrayList(); ...
阅读全文
BulletedList---列表
摘要:数据库为数据源,添加value链接 protected void BulletedList2_DataBound(object sender, EventArgs e) { for (int i = 1; i < BulletedList2.Items.Count; i++) { BulletedList2.Items[i].Val...
阅读全文
AdRotator--广告控件
摘要:AdvertisementFile---包含广告的XML文件
AdRotator1_AdCreated方法,在从Asvertisement中检索到广告后激发
阅读全文
复选列--chenkboxlist
摘要:更改选定索引后激发 protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e) { int n = cbl1.Items.Count; for (int i = 0; i "); Response.Write(t); ...
阅读全文
按钮-Button
摘要:按钮添加JaveScript代码
12onmouseover="c=this.style.backgroundColor; this.style.backgroundColor='#00ff99'; this.style.width='150';"
3onmouseout="this.style.backgroundColor=c;this.style.width='93';" Font-Bold="true"/
阅读全文
浙公网安备 33010602011771号