在CS文件中控制页面控件的显示与否

页面部分代码:
 <tr id="tdCreateDate" style="display: none">
                                    <td nowrap align="left" contenteditable="">
                                        创 建 人:</td>
                                    <td contenteditable="">
                                        <asp:TextBox ID="w_CreateOpt" runat="server" size="25" value="" ReadOnly></asp:TextBox></td>                                       
                                    <td nowrap align="left" contenteditable="">
                                        创建时间:</td>
                                    <td colspan="2" valign="top">
                                        <asp:TextBox ID="w_CreateDate" runat="server"   ></asp:TextBox><a href="javascript:showCalendar('imgNodeValidDate',false,'w_CreateDate',null,'',0);"> <img id="imgNodeValidDate" border="0" src="/CIMS/public/images/calendar_dropdown.gif"></a>
                                        </td>                                        
  </tr>



cs 文件中动态控制控件显示代码:
 ClientScript.RegisterStartupScript(this.GetType(), "Refresh1", "<script>document.all.tdCreateDate.style.display = \"None\";</script>");

posted @ 2007-12-21 15:21  guoan  阅读(215)  评论(0)    收藏  举报