1. 打开新的窗口并传送参数: 8 4reyA
MLM/!N 7
传送参数: f&$;iE
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") f#m@eb
>, 'guaa
接收参数: Y6hV
;[\F
string a = Request.QueryString("id"); PApr8Xe
string b = Request.QueryString("id1"); A:2CP&*
XqhrQU|wM
2.为按钮添加对话框 Ruq>+ }4
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); MU2kA&LH
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") PYs0w6o
1>Vq<z
3.删除表格选定记录 A-_M=\
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; T /IX(b'<
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() H"k\(SPVS
4g}r+!T
4.删除表格记录警告 `.3.n8V
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) &y|Ps eH"
{ O;McPw<&\:
switch(e.Item.ItemType) 2@pEiq3
{ "xHK*
case ListItemType.Item : U 0~BcFpD
case ListItemType.AlternatingItem : zSk`Ou8M
case ListItemType.EditItem: %[9ty`UE
TableCell myTableCell; MtF0/aT
myTableCell = e.Item.Cells[14]; Tz.okCo]z
LinkButton myDeleteButton ; ? u".*!%
myDeleteButton = (LinkButton)myTableCell.Controls[0]; ;;XY&