1. 打开新的窗口并传送参数: &w#!
0 ZM(heQ
传送参数: Dnl<w<}ZU:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") ^lAM /
:aK?Dt Z
接收参数: :8!RGtn
string a = Request.QueryString("id"); 5nUJ9sqA
string b = Request.QueryString("id1"); Ml7
(<J
s2#Ia>5!
2.为按钮添加对话框 h%krA<G9
Button1.Attributes.Add("onclick","return confirm(’确认?’)"); LP=j/qf|
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") d 8DU[p
,/D}a3JD
3.删除表格选定记录 Xv|=RNz
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; @phVfP"M
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() 5&V=$]t
ocFk#FW
4.删除表格记录警告 z
-!w/Bv@
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) Aeb(b+=
{ XzHR^^;u"*
switch(e.Item.ItemType) b:D92pH
{ 8.[F3Tk=
case ListItemType.Item : Fq@o_bI
case ListItemType.AlternatingItem : B*,)@h
case ListItemType.EditItem: 0Gc@AG{
TableCell myTableCell; d<6F'F^w.7
myTableCell = e.Item.Cells[14]; 1^4:l!0D
LinkButton myDeleteButton ; *y!O\-\S#>
myDeleteButton = (LinkButton)myTableCell.Controls[0]; xwf-kwF8^
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);"); nUOi~cs
break; L%T(H<