1. 打开新的窗口并传送参数: z4%uN|V
2jJmE&)7,
传送参数: hg.#DxRi{
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 8`>h}Q$
96cJ8I8
接收参数: Z%zj";C
G
string a = Request.QueryString("id"); tsOrt3
string b = Request.QueryString("id1"); (tah]Bx
1/1Xk,E
2.为按钮添加对话框 H={DB
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); >zsid:
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") XgN` 7!Z
/n~\\9#3
3.删除表格选定记录 U@ ?LP
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; `pf4X/Py
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() (/!r(#K0,'
y.5/?{GL
4.删除表格记录警告 s^0/"j |7
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) oVA?J%EK
{ cMyiW$;
switch(e.Item.ItemType) +d+@u)6
{ F>tQn4
case ListItemType.Item : WV3|?,y]qm
case ListItemType.AlternatingItem : >EL)X
#e
case ListItemType.EditItem: Tus}\0/i>
TableCell myTableCell; {FRAv(,\
myTableCell = e.Item.Cells[14]; :q8b;*:
LinkButton myDeleteButton ; xq-17HKs
myDeleteButton = (LinkButton)myTableCell.Controls[0]; Qy<[7
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); F(4?tX T
break; l Z#o+d2Y
default: tQZs.1=z
break; [A}rbD K
} ju}fL<