[問題] gridview資料無法更新

看板C_Sharp (C#)作者時間14年前 (2011/05/12 21:37), 編輯推噓1(105)
留言6則, 3人參與, 最新討論串1/2 (看更多)
使用ObjectDataSource + gridView 且gridView啟動編輯和刪除功能,測試均成功。 加入以下語法,編輯連結卻沒有作用… 資料表長相: http://0rz.tw/cgsPV 語法中的 LinkButton4 = 刪除連結的ID Label1 = 類別欄位下的資料繫結 protected void gv_Main_Class_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton d_button = (LinkButton)e.Row.Cells[0].FindControl("LinkButton4"); Label ltext = (Label)e.Row.Cells[1].FindControl("Label1"); d_button.OnClientClick = "javascript:return confirm('再一次確認,您確定要對 類別名稱-- " + ltext.Text + " 的資料,進行處置動作嗎?')"; } } ps:以上語法作用:想達成 使用者在刪除資料時,跳出提示視窗 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 116.118.161.39 ※ 編輯: fr730149 來自: 116.118.161.39 (05/12 21:48) ※ 編輯: fr730149 來自: 116.118.161.39 (05/12 23:07)

05/12 23:30, , 1F
拿掉"javascript:"?
05/12 23:30, 1F

05/12 23:33, , 2F
拿掉它的話,就跳不出視窗了…除非有其它方式…
05/12 23:33, 2F

05/13 10:50, , 3F
您問題描述的好像不是很清楚:你是不是想要-->
05/13 10:50, 3F

05/13 10:50, , 4F
用javascript的跳現視窗 來確認asp.net控制項內含事件
05/13 10:50, 4F

05/13 10:51, , 5F
的執行工作?
05/13 10:51, 5F

05/14 09:19, , 6F
是的!感謝你的回應,我已經找到解答,並PO到本版
05/14 09:19, 6F
文章代碼(AID): #1Do-As1o (C_Sharp)
文章代碼(AID): #1Do-As1o (C_Sharp)