1. 打开新的窗口并传送参数: WE Svkm;
2sd=G'7!
传送参数: b09#+CH?
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") |\r\i&|g1
L+0N@`nRF
接收参数: l<)JAT;P
string a = Request.QueryString("id"); zk^7gx3x
string b = Request.QueryString("id1"); FDGKMGZ
/+JP~K
2.为按钮添加对话框 ]zM90$6
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); [9W&1zY
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") ?;.+A4
dE9aE# o
3.删除表格选定记录 <&m
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; 3Ns:O2|
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() /*R' xBr
G3?a~n^b
4.删除表格记录警告 Nno={i1jk
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) ~pBxFA
{ B& f~.UH
switch(e.Item.ItemType) zKAyfn.A
{ =B{$U~}
case ListItemType.Item : #.G>SeTn2}
case ListItemType.AlternatingItem : {D2d({7
case ListItemType.EditItem: },QFyT
TableCell myTableCell; iNrmhiql
myTableCell = e.Item.Cells[14]; }-]s#^'w
LinkButton myDeleteButton ; ewff(e9
myDeleteButton = (LinkButton)myTableCell.Controls[0]; Sm I8&c
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); WZO
0u
break; O [ ; 6E
default: $MVeMgPa
break; W!9f'Yn
} RV @(&