1. 打开新的窗口并传送参数: s(X\7Hz_nC
nzbVI
传送参数: <8(q.
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") x}ZXeqt{{
zW`Hqt;
接收参数: ?<J~SF Tt
string a = Request.QueryString("id"); |K.I%B
string b = Request.QueryString("id1"); xjp0w7L)J
B}7j20:Z
2.为按钮添加对话框 Ifp8oL? S;
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); %0&,_jM/9
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") 5]G%MB/|$
U2`:'
3.删除表格选定记录 /K2[`+-
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; =o~mZ/ 7=M
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() c6jVx_tt.
`"~GqFwy~
4.删除表格记录警告 |g hyH
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) KEy8EB
{ 5Y;&L!T
switch(e.Item.ItemType) /\e_B6pF<
{ p63fpnH
case ListItemType.Item : SEnr"}
case ListItemType.AlternatingItem : PC5$TJnj3
case ListItemType.EditItem:
qbc= kP
TableCell myTableCell; $$ $[Vn_H<
myTableCell = e.Item.Cells[14]; kP5I+B
LinkButton myDeleteButton ; 7Ws88Qs)
myDeleteButton = (LinkButton)myTableCell.Controls[0]; zSA"f_e
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); Q)E3)),
break; [VX5r1-F
default: 0`pCgF
break; <