1. 打开新的窗口并传送参数: Sx?ua<`:d
~-EOjX(X'E
传送参数: K[ (NTp$E
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") R]OpQ[k
5Yl<h)1
接收参数: RoU55mL
string a = Request.QueryString("id"); #9X70|f
string b = Request.QueryString("id1"); /LO-HnJ
ppZDGpp
2.为按钮添加对话框 H
*[_cqnv
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); IB[)TZ2m
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") i'9vL:3
~~v3p>z Rr
3.删除表格选定记录 ?Lyxw]
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; p?B=1vn-2
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() 2Ou[u#H
gW-V=LV (
4.删除表格记录警告 'yL%3h
_@
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) Ag&0wN+jTM
{ H-~6Z",1
switch(e.Item.ItemType) QA<Jr5Ys
{ `&D|>tiz
case ListItemType.Item : GM3f-\/
case ListItemType.AlternatingItem : cm?\
-[cV
case ListItemType.EditItem: ~ ip,Nl
TableCell myTableCell; S-k8jm
myTableCell = e.Item.Cells[14]; # a<Gxj
LinkButton myDeleteButton ; '7+4`E
myDeleteButton = (LinkButton)myTableCell.Controls[0]; cIav&