我爱Aspx >> Asp.Net >> ASP.NET程序中常用的三十三种代码ASP.NET程序中常用的三十三种代码
p; 1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
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.删除表格记录警告
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
switch(e.Item.ItemType)
{
case ListItemType.Item :
case ListItemType.AlternatingItem :
case ListItemType.EditItem:
Ҷƪл˵?
asp.net 1.1中url重写的问题[05-20]
ASP.NET+AJAX解决网页打开等待问..[05-20]
编写ASP.NET应用程序的十大技巧[05-20]
ASP.Net实现将Word转换PDF格式[05-20]
深入探讨.NET中的钩子技术[05-20]
ASP.NET中实现Flash与.NET的紧密..[05-20]
WIN 2003下ASP.Net站点无法使用用..[05-20]
Asp.Net 学习资源列表[05-20]
.NET中一些常见代码的性能问题[05-20]
用ASP.NET实现网络空间管理[05-20]
Visual Studio 2005 中的新的 Da..[05-20]
asp.net 1.1中url重写的问题[05-20]
ASP.NET+AJAX解决网页打开等待问..[05-20]
编写ASP.NET应用程序的十大技巧[05-20]
ASP.Net实现将Word转换PDF格式[05-20]
深入探讨.NET中的钩子技术[05-20]
ASP.NET中实现Flash与.NET的紧密..[05-20]
WIN 2003下ASP.Net站点无法使用用..[05-20]
Asp.Net 学习资源列表[05-20]
.NET中一些常见代码的性能问题[05-20]