1. 打开新的窗口并传送参数: rfXM*h
fx99@%Ii
传送参数: \7$m[h{l
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") b1\z&IdC
QEQ8gfN9>
接收参数: Kcsje_I-M
string a = Request.QueryString("id"); q.K >v'
string b = Request.QueryString("id1"); ]^8:"Ky'
ky#<\K1}'
2.为按钮添加对话框 u17Da9@;
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); _@F4s
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") / (W{`
!CPv{c`|qg
3.删除表格选定记录 v?K
XTc%Z
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
lU:z>gC
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() uQ5NN*C=
TN7kt]a2
4.删除表格记录警告 O<L/m[]
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) SKD!V6S
{ o7DDL{iR/
switch(e.Item.ItemType) e4khReF;
{ rZKv:x}{6
case ListItemType.Item : No=f&GVg
case ListItemType.AlternatingItem : '?_I-="Mr
case ListItemType.EditItem: \^|ncu:T
TableCell myTableCell; t{F6+d p
myTableCell = e.Item.Cells[14]; L6r&