aspx文件中js给隐藏域赋值后台取出来以后是空,我设断点是最后执行的js,求高手!!!!
我的需求是点申请按钮的时候,出现确认框,用户选择是的时候返回true,用户选择取消的时候返回false。
先根据someone的值,通过js脚本中参数访问aspx文件中的js中,然后给隐藏域控件赋值,然后根据值继续做后面的操作,但是一直没有取来hd隐藏域的值。
<script type="text/javascript"> function yesorno(someone) { alert(someone); if(confirm('您选择的用户'+someone+'已有相应团队是否继续?')) { document.getElementById("hd").value='true'; alert(document.getElementById("hd").value); } else { document.getElementById('hd').value="false"; alert(document.getElementById("hd").value); } } </script><asp:HiddenField ID="hd" runat="server" />