zoukankan      html  css  js  c++  java
  • ASP.NET程序中常用的三十三种代码(转载)

    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

     }
     

    }
      

    剩下的在http://www.cnblogs.com/zhouxiaxue/archive/2007/02/01/636531.html

    新浪的博客真菜,限制只能放这么点。。倒是挺花哨

    和CSDN差远了

  • 相关阅读:
    iscroll.js & flipsnap.js
    IE8’s Substr() Bug
    chrome扩展,如何阻止浏览自动关闭桌面通知.
    临时邮箱
    多个显示器, window.open的定位
    页面刷新
    PipelineDB Install and Test
    CitusDB UPSERT
    Kafka部署
    ambari-cassandra-service
  • 原文地址:https://www.cnblogs.com/yeye518/p/2231743.html
Copyright © 2011-2022 走看看