[問題] asp.net的onclientclick是否可以取得js …
as title,
我有個asp.net的button,
請問有辦法在*.aspx.cs裡取得confrim的return嗎?
thanks a lot.
貼錯code(遮臉)
*.aspx端
<script type="text/javascript">
function val()
{
if(confirm("are you sure"))
{
return true;
}else
{
return false;
}
}
</script>
<asp:Button ID="ok" runat="server" Text="ok"
OnClientClick="return val()" />
我想問的是如何在觸發val()後在*.aspx.cs端取值?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.118.33.103
→
04/08 22:29, , 1F
04/08 22:29, 1F
※ 編輯: zeat 來自: 122.118.33.103 (04/08 22:41)
→
04/08 22:41, , 2F
04/08 22:41, 2F
那請問一下, 因為我是希望在delete資料之前跳出confirm提醒user, 依照您的講法
是不是確定才會繼續執行server端(*.aspx.cs)的程式刪除資料, 也就是將code簡寫成
<asp:Button ID="del" runat="server" Text="delete" OnClientClick="return
confirm("are you sure delete the data?")" />
也可以達到我要的目的嗎?
※ 編輯: zeat 來自: 122.118.33.103 (04/08 23:09)
推
04/09 00:20, , 3F
04/09 00:20, 3F
→
04/09 07:19, , 4F
04/09 07:19, 4F
→
04/13 21:37, , 5F
04/13 21:37, 5F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):