1. 打开新的窗口并传送参数: LFu%v7L`
zp4W'8
传送参数: Y*LaBxt Q
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") X_?97iXjx
c/aup
接收参数: '{[),*nC n
string a = Request.QueryString("id"); \#,t O%D
string b = Request.QueryString("id1"); MGt]' }
JTW)*q9a
2.为按钮添加对话框 Q6'nSBi:A_
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); L*JPe"N-e
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") ;>"nn
VW
uf' 4'
3.删除表格选定记录 76H!)={
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; i::\Z$L";i
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() n&Yk<
]Pc^#=(R0
4.删除表格记录警告 io%')0p5q
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) ziEz.Wn"
{ kXc25y'blP
switch(e.Item.ItemType) Q0cRH"!:
{ XL5Es:"+?S
case ListItemType.Item : H0*,8i5I
case ListItemType.AlternatingItem : @pza>^wk
case ListItemType.EditItem: RBGX_v?
TableCell myTableCell; v:|(8Y
myTableCell = e.Item.Cells[14]; )qU7`0'8
LinkButton myDeleteButton ; .$rC0<G[K
myDeleteButton = (LinkButton)myTableCell.Controls[0]; ra6o>lI(,
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); Vpp&