萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp.net編程 >> ASP.NET實用代碼片段

ASP.NET實用代碼片段

   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.刪除表格記錄警告

ASP.NET實用代碼片段 三聯

  5.點擊表格行鏈接另一頁

copyright © 萬盛學電腦網 all rights reserved