资源名称:ASP.NET程序中常用的三十三种代码
内容简介:
-
打开新的窗口并传送参数:
传送参数:
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:
资源截图:

版权申明
本文为小栈资源网(www.xzres.com)原创内容,受版权保护。
转载请务必注明出处及原文链接,未经授权禁止任何形式的改编、商用及二次分发。
本文提供的资源及内容仅用于个人学习、研究用途,严禁用于商业目的。
如发现内容侵犯了您的合法权益,请联系我们:jieligw@qq.com,我们将在24小时内处理。
















请登录后查看评论内容