1. 打开新的窗口并传送参数: %eJGte-
meCC?YAB
传送参数: >/#KI~}'N
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") VOr 1
3 ( ]M{4j
接收参数: !=y]Sv~h
string a = Request.QueryString("id"); ^::EikpF%
string b = Request.QueryString("id1"); W;1|+6x
)NO<s0?&
2.为按钮添加对话框 ;P;((2_X9
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); m] W5+
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") E( h<$w8s
dVQ-k
3.删除表格选定记录 ~h"/Tce
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; XUF\r]B,9
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() *c)uGz'cD
ZbT/$\0(6
4.删除表格记录警告 !I\!;b
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) < Z|Ep1W
{ \3Q&~j
switch(e.Item.ItemType) g!i45-n3gt
{ =E&OuX-R
case ListItemType.Item : unJ R=~E
case ListItemType.AlternatingItem : ql GW.jY.
case ListItemType.EditItem: q\rC5gk>
TableCell myTableCell; CdUAy|!`R
myTableCell = e.Item.Cells[14]; ?go:e#
LinkButton myDeleteButton ; j&