1. 打开新的窗口并传送参数: "Sb<"$:
Lqa|9|!
传送参数: 9@3cz_[J
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") %r
=9,IJ
'LX]/D
接收参数: omu)s
'8
string a = Request.QueryString("id"); xu<oQBt
string b = Request.QueryString("id1"); \0fS;Q^{j
15J t
@{<r
2.为按钮添加对话框 }ebu@)r
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); "rVf{
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") X:2)C-l?
&9OnN<mT1
3.删除表格选定记录 !FA[
]d 4
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; -4Hf5!
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() 2QIx~Er
Ci9]#)"c
4.删除表格记录警告 %n B}Hq ;
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) WzhY4"p
{ _ci8!PP
switch(e.Item.ItemType) GtLnh~)
{ )=TS)C4
case ListItemType.Item : j"5 $m@lgn
case ListItemType.AlternatingItem : ;s\ck:Xg
case ListItemType.EditItem: ^!A@:}t>
TableCell myTableCell; /0 2-0mNv
myTableCell = e.Item.Cells[14]; ;Z 6ngS
LinkButton myDeleteButton ; B>r>z5
myDeleteButton = (LinkButton)myTableCell.Controls[0]; F a+#bX7
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); T|^KG<uPV!
break; R1?LB"aN
default: HRg< f= oz
break; 9M;k(B!
} 2A&Y