1. 打开新的窗口并传送参数: j2.|ln"!
~{B7 k:
传送参数: =llvuUd\n
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") pF:$
ko
m6&~HfwN
接收参数: 2E/"hQw
string a = Request.QueryString("id"); l2rd9-T
string b = Request.QueryString("id1"); J0\Fhe0'
}mq6]ZrK
2.为按钮添加对话框 wyj{zWRJp
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); BsqP?/
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") (X1e5j>Ru
l%pu HZ)t
3.删除表格选定记录 5Y'qaIFR
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; lVR~Bh
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() T?soJ]A
?2;&O`x*
4.删除表格记录警告 ag#S6E^%S
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) 8Pn#+IvCE
{ %x{kc3PnO
switch(e.Item.ItemType) zrL$]Oy}x
{ w/S%YW3*
case ListItemType.Item : [OV"}<V
case ListItemType.AlternatingItem : mPN@{.(j
case ListItemType.EditItem: aa?b`[Xa
TableCell myTableCell; H*&f: