标题:请教一个关于控件的问题
只看楼主
anor
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-11-21
结帖率:0
已结贴  问题点数:0 回复次数:3 
请教一个关于控件的问题
创建控件时出错: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
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
得分:20 
一个自定义控件?

[ 本帖最后由 cnfarer 于 2011-11-23 12:58 编辑 ]

★★★★★为人民服务★★★★★
2011-11-23 12:56
hflhm999
Rank: 2
等 级:论坛游民
帖 子:6
专家分:15
注 册:2011-12-1
得分:0 
编辑器控件FreeTextBox1 没用过的飘过~~附个网上的说明:http://hi.baidu.com/ishb/blog/item/e1a379122b9d4354f919b805.html等楼下的来解
2011-12-01 21:50
hflhm999
Rank: 2
等 级:论坛游民
帖 子:6
专家分:15
注 册:2011-12-1
得分:0 
再来个详解:http://hi.baidu.com/ishb/blog/item/d6fb470880bfec35e8248806.html
我对比下,不知对不对哈: </FTB:FreeTextBox> 这个写法跟他上面说的不太对,:<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation="InternalResource" UtilityImagesLocation="InternalResource"
SupportFolder="~/aspnet_client/FreeTextBox/"
AllowImageDelete=true
AllowImageUpload=true
AllowDirectoryCreate=false
AllowDirectoryDelete=false
runat="Server" />
没有这:</FTB:FreeTextBox>  楼下继续~
2011-12-01 21:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-355885-1-1.html




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

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