我在.aspx.cs的page_load里判断 数据表 里有无记录
如果有 hide_tmp=1 如果无  hide_tmp=0如果 hide_tmp=0 就弹出另外一输入页面 要输入一条记录
<script>
if(document.getElementById("tmp").Value=="0")
{
window.onload=first();
}
function first()
{
window.showModalDialog("admin/Aud_Meet_Son.aspx","","dialogHeight=310px;dialogWidth=550px;center=1;help=0;resizable=0;status=0;scroll=0;edge=sunken");
}
</script>
请问这样写 有什么错啊  我调试了好久 都不行;

解决方案 »

  1.   

    <input type="hidden" id="tmp" value="0" runat="server">
      

  2.   

    <input type="hidden" id="hide_tmp" value="0" runat="server">
      

  3.   

    1. 逻辑错误<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <script>function Test()
    {
    if(document.getElementById("tmp").value=="0")
    {
    first();
    }
    }function first()
    {
    window.showModalDialog("admin/Aud_Meet_Son.aspx","","dialogHeight=310px;dialogWidth=550px;center=1;help=0;resizable=0;status=0;scroll=0;edge=sunken");
    }
    </script></HEAD><BODY onload="Test()">
    <input type="hidden" id="tmp" value="0"></BODY>
    </HTML>
    2. 
    应该是:if(document.getElementById("tmp").value=="0")
    而不是 :if(document.getElementById("tmp").Value=="0")