| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 742 人关注过本帖
标题:请教一个关于控件的问题
取消只看楼主 加入收藏
anor
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-11-21
结帖率:0
收藏
已结贴  问题点数:0 回复次数:0 
请教一个关于控件的问题
创建控件时出错:freetextbox必须放在具有runat=server的窗体标记内

源代码如下

<body>
    <form id="form1" runat="server">
    <div>
       <table id="Table2" align="center" border="1" cellpadding="0" cellspacing="0" style="border-right: #ccccff 1px solid;
           border-top: #ccccff 1px solid; font-size: 9pt; z-index: 101; left: 0px; border-left: #ccccff 1px solid; border-bottom: #ccccff 1px solid; position: absolute; top: 0px;
           height: 550px" width="635">
           <tr>
               <td align="center" bgcolor="#6699ff" class="Tetle" colspan="2" style="height: 27px">
                   <span class="Tetle" style="height: 27px">添 加 文 章 信 息</span></td>
           </tr>
           <tr>
               <td align="left" colspan="2" valign="top">
                   <table id="Table1" border="0" cellpadding="0" cellspacing="0" style="border-right: #ccccff 1px solid;
                       border-top: #ccccff 1px solid; font-size: 9pt; border-left: #ccccff 1px solid;
                       width: 616px; border-bottom: #ccccff 1px solid" width="616">
                       <tr>
                           <td style="width: 68px">
                               文章标题:</td>
                           <td>
                               <asp:TextBox ID="txtFileName" runat="server" BorderStyle="Groove" Width="496px"></asp:TextBox>
                               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFileName"
                                   Display="Dynamic" ErrorMessage="**">**</asp:RequiredFieldValidator></td>
                       </tr>
                       <tr style="color: #000000">
                           <td style="width: 68px">
                               关键字:</td>
                           <td>
                               <asp:TextBox ID="txtKeyWords" runat="server" BorderStyle="Groove" Width="496px"></asp:TextBox>
                               <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtKeyWords"
                                   ErrorMessage="**">**</asp:RequiredFieldValidator></td>
                       </tr>
                       <tr style="color: #000000">
                           <td style="width: 68px; height: 22px;">
                               文章来源:</td>
                           <td style="height: 22px">
                               <asp:TextBox ID="txtFrom" runat="server" BorderStyle="Groove" Width="496px"></asp:TextBox>
                               <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFrom"
                                   Display="Dynamic" ErrorMessage="**">**</asp:RequiredFieldValidator></td>
                       </tr>
                       <tr style="color: #000000">
                           <td style="width: 68px; height: 38px;">
                               内容简介:</td>
                           <td style="height: 38px">
                               <asp:TextBox ID="txtFileDec" runat="server" BorderStyle="Groove" TextMode="MultiLine"
                                   Width="496px"></asp:TextBox></td>
                       </tr>
                       <tr>
                           <td style="width: 68px">
                               网站链接:</td>
                           <td>
                               <asp:TextBox ID="txtLink" runat="server" BorderStyle="Groove" Width="496px">http://</asp:TextBox></td>
                       </tr>
                   </table>
               </td>
           </tr>
           <tr>
               <td style="width: 45px; height: 324px">
                   内容:<FTB:FreeTextBox ID="FreeTextBox1" runat="server" ButtonPath="/images/ftb/officeXP/" ToolbarType="Office2000" Height="500px" Width="700px">
                   </FTB:FreeTextBox>    <!--这段代码报错-->
               <br />
               </td>
           </tr>
           <tr>
               <td style="width: 45px; height: 23px">
                   <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                       <tr>
                           <td style="width: 139px">
                               <asp:Label ID="Label1" runat="server" Text="上传附件图片"></asp:Label></td>
                           <td>
                               <asp:Image ID="Image1" runat="server" Height="130px" Width="149px" />
                               <asp:Label ID="Label2" runat="server" ForeColor="#FF3333" Text="如果要替换原来的图片请直接上传新的图片即可替换"></asp:Label></td>
                       </tr>
                       <tr>
                           <td style="width: 139px; height: 15px">
                               添加图片</td>
                           <td style="height: 15px">
                               <input id="PostFile" runat="server" name="PostFile" size="58" style="border-right: black 1px solid;
                                   border-top: black 1px solid; border-left: black 1px solid; width: 466px; border-bottom: black 1px solid;
                                   height: 22px" type="file" /></td>
                       </tr>
                       <tr>
                           <td style="width: 139px; height: 15px">
                               添加附件</td>
                           <td style="height: 15px">
                               <input id="File1" runat="server" name="PostFile" size="58" style="border-right: black 1px solid;
                                   border-top: black 1px solid; border-left: black 1px solid; width: 466px; border-bottom: black 1px solid;
                                   height: 22px" type="file" /></td>
                       </tr>
                   </table>
               </td>
           </tr>
           <tr>
               <td align="center" colspan="2">
                   <asp:Button ID="btnAdd" runat="server" Text="添  加" />
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                   <asp:Button ID="btnPreview" runat="server" CausesValidation="False" Text="清除所有" />
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</td>
           </tr>
       </table>
   
    </div>
    </form>
</body>
</html>



写了public override void VerifyRenderingInServerForm(Control control)
还是报同样的错,请问有什么办法解决?
搜索更多相关主题的帖子: 635 absolute position 源代码 server 
2011-11-21 23:56
快速回复:请教一个关于控件的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013504 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved