ASP.NET实用代码片段
发布时间:2015-06-05 来源:查字典编辑
摘要:1.打开新的窗口并传送参数:传送参数:response.write("")接收参数:stringa=Request.QueryString(...
1. 打开新的窗口并传送参数:
传送参数:
response.write("")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attributes.Add("onclick","return confirm(’确认?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")
3.删除表格选定记录
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString()
4.删除表格记录警告
5.点击表格行链接另一页