1. 打开新的窗口并传送参数: $}c@S0%P"
= 8e8!8
传送参数: CoN/L`.SN
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") @tp7tB ;
_+Kt=;Y8
接收参数: =
y,avR
string a = Request.QueryString("id"); 93eqFCF.
string b = Request.QueryString("id1"); V.[#$ip6:
3jVm[c5%]
2.为按钮添加对话框 s7.*o@G
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); hd
BC ^n
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") :|mkI#P.
NS~knR\&
3.删除表格选定记录 ~,65/O
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; 'i-O
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() n^)9QQ
WQC6{^/4[1
4.删除表格记录警告 CXFAb1m
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) [$Bb'],k
{ aM}"DY-_
h
switch(e.Item.ItemType) y5D?Bg|M
{ Bx!` UdRn
case ListItemType.Item : W)~.o/;
case ListItemType.AlternatingItem : ! HC<aWb
case ListItemType.EditItem: OYy !4Fp
TableCell myTableCell; "kg$s5o
myTableCell = e.Item.Cells[14]; { xoo9jq-
LinkButton myDeleteButton ; OkUpgXU
myDeleteButton = (LinkButton)myTableCell.Controls[0]; B\&