1. 打开新的窗口并传送参数: -Lbi eS%
_lj&}>l
传送参数: :Pf2oQ
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") &*wc` U
Da"GYEC
接收参数: +_LWN8F
string a = Request.QueryString("id"); k3B-;%3I;
string b = Request.QueryString("id1"); ;J3
(EB
t!,GI&
2.为按钮添加对话框 !%4&O
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); q
k+(Ccl
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") +Qe"O0
Iz[ T.$9
3.删除表格选定记录 B#U:6Ty
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; 2{o
e J
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() 0*Is#73rjY
]#VNZ#("
4.删除表格记录警告 " ~&d=f0m
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) {)d{:&*K.
{ mlD 1 o
switch(e.Item.ItemType) d=_Wgz,d
{ +sc--e?
case ListItemType.Item : d2e4=/A%
case ListItemType.AlternatingItem : Zr.6J*&