1. 打开新的窗口并传送参数: ^Mc9MZ)
Ar,n=obG
传送参数: fn5-Tnsq*
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
Su?cC/
+w?R4Sxjn
接收参数: 8 Zp^/43
string a = Request.QueryString("id"); Kdp($L9r
string b = Request.QueryString("id1"); @@{5]Y
z,^~H
2.为按钮添加对话框 )78T+7Kq
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); R)\^*tkz7
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") d(ypFd9z
Vr( Z;YO
3.删除表格选定记录 02*qf:kTnA
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; (1GU
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() Hk h'h"_r
Myiv#rQ)
4.删除表格记录警告 LfFXYX^
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) Yb/*2iWX
{ fHH
switch(e.Item.ItemType) NY^0$h
{ !8cV."~
case ListItemType.Item : V(DY!f_%
case ListItemType.AlternatingItem : ;`:YZ+2
Z
case ListItemType.EditItem: p@4GI[ 4
TableCell myTableCell; |C<#M<
myTableCell = e.Item.Cells[14]; .1{{E8Fj
LinkButton myDeleteButton ; b"N!#&O