当前位置:编程学习 > C#/ASP.NET >>

textbox无法输入

急,gridview中生成的textbox无法输入数据,不知道是不是页面放了太多东西,但又实在看不出是哪错了。。。
<head runat="server">
    <title>在线考试</title>
    <link href="../StyleSheet.css"  rel="Stylesheet"  type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div style="background:url(/img/top.jpg) no-repeat;width:1024px; height:120px; margin:0 auto;" >
        <span style="text-align:right; vertical-align:middle">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
                </asp:Timer>
                <asp:Label ID="lbtime" runat="server" ></asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>
        </span>
        </div>
       
   <div id="topmenu" style="background:url(/img/caption.jpg) no-repeat; width:1024px; height:45px; margin:0 auto;">
   <a name="top" class="a1"></a>
    <ul>
    <li><asp:LinkButton ID="Link1" runat="server" OnClick="Link1_Click">单选题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link2" runat="server" OnClick="Link2_Click">多选题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link3" runat="server" OnClick="Link3_Click">判断题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link4" runat="server" OnClick="Link4_Click">填空题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link5" runat="server" OnClick="Link5_Click">简答题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link6" runat="server" OnClick="Link6_Click">设计题</asp:LinkButton></li>
    <li><asp:LinkButton ID="Link7" runat="server" OnClick="Link7_Click">交卷/退出</asp:LinkButton></li>
        </ul>
    </div>
    
    <div style="margin:0 auto; text-align:center; border:solid 1px #ccc; width:1024px; padding:0; background-color:#F7FAFF">
     <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
             <tr>
       <asp:Panel ID = "Panel1" runat="server" Visible="false"  >
   ...     </asp:Panel>
    <table align="center" width="1024px" cellpadding="0" cellspacing="0" style="border-collapse:collapse; border-bottom-style:none; ">
           <tr>
        <td align="center"  style="font-family:仿宋; font-size:22px; font-weight:bold; line-height:37px"><asp:Panel ID="Panel2" runat="server" Visible="true">
        
        <asp:Label ID="Label30" runat="server" Text="<<" />
        <asp:Label ID="lblPaperName" runat="server" ></asp:Label>
        <asp:Label ID="Label3" runat="server" Text=">>" /></asp:Panel>
         </td>
        </tr>
        <tr>
    <td style="text-align:left">
               <table width="100%" style="text-align:left; border-style:none; border:0; line-height:30px" align="center">
                               <tr>
                        <td>
                            <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False"  Visible="false"
                                Width="100%">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate> 
                                        四、填空题(本大题共
                                            <asp:Label ID="Label18" runat="server" > </asp:Label>小题,每小题
                                            <asp:Label ID="Label45" runat="server"> </asp:Label>分)
                                                                  </HeaderTemplate> <HeaderStyle Font-Size="13pt" HorizontalAlign="Left" />
                                        <ItemTemplate>
                                            <TABLE ID="Table5" align="center" border="0" cellPadding="1" cellSpacing="1" 
                                                width="100%">
                                                <tr align=left>
                                                    <td>
                                                        <asp:Label ID="Label13" runat="server">   <%# Container.DataItemIndex+1 %>
                                                        </asp:Label>
                                                        <asp:Label ID="Label14" runat="server" Text='<%# Eval("FrontTitle","、{0}") %>'>
                                                        </asp:Label>
                                                        <asp:TextBox ID="TextBox1" runat="server" BorderStyle="None" 
                                                            style="BORDER-BOTTOM:   gray   1px   solid" Width="100px"></asp:TextBox>
                                                        <asp:Label ID="Label15" runat="server" Text='<%# Eval("BackTitle") %>'>
                                                        </asp:Label>

                                                        <asp:Label ID="Label43" runat="server" Text='<%# Eval("ID") %>' 
                                                            Visible="False"></asp:Label>
                                                    </td>
                                                </tr>
                                            </TABLE>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                
                            </asp:GridView>
                        </td>
                    </tr>
    
                        <tr>
                        <td>
                            <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False"  Visible="false" 
                                Width="100%">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate> 
                                        五、简答题(本大题共
                                            <asp:Label ID="Label32" runat="server"> </asp:Label>小题,每小题
                                            <asp:Label ID="Label31" runat="server"> </asp:Label>分)
                                                                                    </HeaderTemplate> <HeaderStyle Font-Size="13pt" HorizontalAlign="Left" />
                                        <ItemTemplate>
                                            <TABLE ID="Table6" align="center" border="0" cellPadding="1" cellSpacing="1" 
                                                width="100%">
                                                <tr>
                                                    <td align=left>
                                                        <asp:Label ID="Label46" runat="server">   <%# Container.DataItemIndex+1 %>
                                                        </asp:Label>
                                                        <asp:Label ID="Label34" runat="server" Text='<%# Eval("Title","、{0}") %>'>
                                                        </asp:Label>
                                                        <br />   
                                                        <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Width="90%" Height="150px" Enabled="true"  ></asp:TextBox>

                                                        <asp:Label ID="Label44" runat="server" Text='<%# Eval("ID") %>' 
                                                            Visible="False"></asp:Label>
                                                    </td>
                                                </tr>
                                            </TABLE>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                
                            </asp:GridView>
                        </td>
                    </tr>
    </table>
       
                        </td>
                    </tr>
      <tr><td align="center"><a href="#top" class="a1">返回顶端</a></td></tr>
    </table> </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
--------------------编程问答-------------------- 看你代码,建议你用repeater --------------------编程问答-------------------- bu zhi dao! --------------------编程问答-------------------- 楼主,你那个倒计时---相当耗费 服务器资源,建议你换成js倒计时吧。
有可能是你浏览器的问题,不能输入东西,我以前的也碰到过。 --------------------编程问答-------------------- HTML代码比这个代码更容易找出错误。 --------------------编程问答-------------------- 太长了!! --------------------编程问答-------------------- 不要给textbox设置那么多样式,可能是受影响 --------------------编程问答--------------------
引用 3 楼 hundanbaobao001 的回复:
楼主,你那个倒计时---相当耗费 服务器资源,建议你换成js倒计时吧。
有可能是你浏览器的问题,不能输入东西,我以前的也碰到过。



删掉那个倒计时的就可以了,谢谢~ --------------------编程问答-------------------- 你把textbox1 的CSS去掉

textbox1 为什么设置 enable属性?
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,