西安力洋网站建设

西安力洋网络
  • ASP.net常见问题集锦

  • 发布者:本站 发布时间:2010/3/1 11:45:45
  • asp.net常见问题解决办法

    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:
    TableCell myTableCell;
    myTableCell = e.Item.Cells[14];
    LinkButton myDeleteButton ;
    myDeleteButton = (LinkButton)myTableCell.Controls[0];
    myDeleteButton.Attributes.Add("onclick","return confirm('您是否确定要删除这条信息');");
    break;
    default:
    break;
    }

    }

  • 返回列表
    相关阅读
    更多
    深度挖掘网站的商用价值,化繁为简的设计,为企业找到直接有效的解决方案
    +86 (029) 88765320
    +86 15829904657
    地址:西安市太华北路369号
    万达广场4#23F P.C:7100001
    boss@178365.net
    在线咨询: 985224206
    互联网协会成员单位
    西安力洋之星网络技术有限公司 | 版权所有
    Copyright 2008-2020 Liyang.Inc All Rights Reserved.
    Liyang.Inc