不能在UserControl中使用CheckBox缺少FORM Tag(ASPX)

时间:2015-02-04 10:20:02

标签: asp.net checkbox controls

如何在UserControl中使用? 我总是得到错误,CheckBox应放在FormTag中(使用runat = server),它仍然存在于MasterPage上,并且不允许有两个......

UserControl代码:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlOrderEmailsDialog.ascx.cs" Inherits="WebClient.Controls.ctrlOrderEmailsDialog" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<div id="OrderEmailDialog" runat="server">
    <table id="OrderEmailDialogTable">
        <tbody>
            <tr>
                <th>Nr.</th>
                <td>
                    <asp:Label ID="labelId" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <th>ReturnReceipt:</th>
                <td>
                    <%--<telerik:RadButton ID="checkboxReturnReceipt" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton" AutoPostBack="false">
                        <ToggleStates>
                            <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled"
                                Selected="true"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"></telerik:RadButtonToggleState>
                        </ToggleStates>
                    </telerik:RadButton>--%>
                    <asp:CheckBox ID="checkboxReturnReceipt" runat="server" />
                </td>
            </tr>
            <tr>
                <th>Mailtext:</th>
                <td>
                    <asp:Label ID="OrderEmailText" runat="server">
                    </asp:Label>
                </td>
            </tr>
        </tbody>
    </table>
</div>

表单标记(已存在于SiteMaster页面中):

<form id="MainForm" runat="server">

System.Web.HttpException:
&#34;控件ctrlOrderEmailsDialog_checkboxReturnReceipt类型CheckBox必须位于带有runat = server的表单标记中。&#34;现存......

你们能给我一点暗示吗? 谢谢。

// SIL

0 个答案:

没有答案