本文介绍了服务器端混淆消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp中的服务器端代码中显示确认消息
how to show the confirmation message in sever side code in asp
推荐答案服务器端-代码隐藏-是 - 否 - 认可 - 消息箱中-ASPNet.aspx [ ^ ] http:/ /forums.asp/t/1904944.aspx [ ^ ]
以下代码段可以帮助您: The below snippet may help you: <asp:button id="Button1" text="Delete" onclick="CallDeleteFunction" onclientclick="return ConfirmOnDelete();" xmlns:asp="#unknown" /> <input id="hidden_Value" type="hidden" runat="server" />
<script type="text/javascript"> function ConfirmOnDelete() { var ret=confirm('Do you want to delete the item?'); if (ret==true) { document.getElementById('hidden_Value').value="OK"; } else { document.getElementById('hidden_Value').value="Cancel"; } } </script>
代码落后:
Code behind:
public void CallDeleteFunction(object sender, Eventargs e) { string hiddenVar=hidden_Value.Value; if(hiddenVar=="OK") { Call some delete operation.... } else { Do nothing.... } }希望它有所帮助。 -Anurag
Hope it helps. -Anurag
更多推荐
服务器端混淆消息
发布评论