1. 打开新的窗口并传送参数: q~.\NKc
`N}<lg(0#
传送参数: -]\%a=]
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") URmx8=q
gKcP\m
接收参数: `DO`c>>K
string a = Request.QueryString("id"); 0U ?1Yh7
m
string b = Request.QueryString("id1"); mkTf}[O
|4pE"6A
2.为按钮添加对话框 Fs<kMT
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); ^~|P[}
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") _;$VH4(BI
'Wl))lB
3.删除表格选定记录 &fq-U5zH
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; Skl1%`
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() '@RlKMnN
/ O6n[qj|
4.删除表格记录警告 :x]gTZ?
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) +bI &0`
{ ;%odN
d
switch(e.Item.ItemType) ^10*s,(uS?
{ pq+Gsu1^
case ListItemType.Item : =El.uBz{
case ListItemType.AlternatingItem : 9mwL\j
case ListItemType.EditItem: j% !
TableCell myTableCell; c, \TL
]
myTableCell = e.Item.Cells[14]; f8_5.vlw
LinkButton myDeleteButton ; YMad]_XOP
myDeleteButton = (LinkButton)myTableCell.Controls[0]; Q<P],}?:
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); ]3xnq<
break; ~d?7\:n
default: #z-6mRB
break; Fe%Q8RIh_
} c'&