明天答辩,系统却出现了一个超奇怪的问题:我的一个RadioButtonList1控件,在运行时却出现了“类型“RadioButton”的控件“RadioButtonList1_0”必须放在具有 runat=server 的窗体标记内。”我的控件明明是 RadioButtonList1的,请教是怎么回事,改怎么处理,紧急啊

解决方案 »

  1.   

    <form runat="server".....>
    <asp:RadioButtonList.... runat="server">
    </asp:RadioButtonList>
    </form>
    注意必须在runat="server"的<form>里,并且自身也需要runat="server"标记。
      

  2.   

    一般就如二楼所说了,如果有问题,请把你的aspx文件贴一下
      

  3.   

    <%@ Register TagPrefix="uc1" TagName="directe" Src="directe.ascx" %>
    <%@ Page language="c#" Codebehind="homework.aspx.cs" AutoEventWireup="false" Inherits="SAMS.homework" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>homework</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体">
    <TABLE id="Table1" style="Z-INDEX: 101; LEFT: 192px; WIDTH: 424px; POSITION: absolute; TOP: 1296px; HEIGHT: 368px"
    cellSpacing="1" cellPadding="1" width="424" border="1">
    <TR>
    <TD align="center" colSpan="2">作业发布</TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 75px" align="center">语文:</TD>
    <TD style="HEIGHT: 75px" vAlign="top"><asp:textbox id="tbyw" runat="server" Height="72px" TextMode="MultiLine" Width="328px"></asp:textbox></TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 77px" align="center">数学:</TD>
    <TD style="HEIGHT: 77px" vAlign="top"><asp:textbox id="tbsx" runat="server" Height="72px" TextMode="MultiLine" Width="328px"></asp:textbox></TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 75px" align="center">英语:</TD>
    <TD style="HEIGHT: 75px" vAlign="top"><asp:textbox id="tbyy" runat="server" Height="72px" TextMode="MultiLine" Width="328px"></asp:textbox></TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 71px" align="center">科学:</TD>
    <TD style="HEIGHT: 71px" vAlign="top"><asp:textbox id="tbkx" runat="server" Height="72px" TextMode="MultiLine" Width="328px"></asp:textbox></TD>
    </TR>
    <TR>
    <TD>今天日期:</TD>
    <TD></TD>
    </TR>
    <TR>
    <TD align="center" colSpan="2"></TD>
    </TR>
    </TABLE>
    </FONT>
    <P><FONT face="宋体"></FONT>&nbsp;</P>
    <TABLE id="Table3" style="Z-INDEX: 102; LEFT: 248px; POSITION: absolute; TOP: 40px" cellSpacing="1"
    cellPadding="1" width="300" border="0">
    <TR>
    <TD style="WIDTH: 81px">今天日期:</TD>
    <TD vAlign="top"><FONT face="宋体"></FONT></TD>
    </TR>
    </TABLE>
    </form>
    <P><FONT face="宋体"><asp:label id="Label2" style="Z-INDEX: 103; LEFT: 320px; POSITION: absolute; TOP: 416px" runat="server"
    Width="329px"></asp:label>
    <TABLE id="Table4" style="Z-INDEX: 104; LEFT: 248px; WIDTH: 480px; POSITION: absolute; TOP: 104px; HEIGHT: 36px"
    height="36" cellSpacing="1" cellPadding="1" width="480" border="0">
    <TR>
    <TD>
    <hr>
    <TABLE id="Table2" style="WIDTH: 480px; HEIGHT: 136px" cellSpacing="0" cellPadding="1"
    width="480" border="1" borderColor="#003399" borderColorLight="#333399">
    <TR>
    <TD style="HEIGHT: 21px" align="center"><FONT face="宋体">作业发布</FONT></TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 30px" vAlign="top"><asp:radiobuttonlist id="RadioButtonList1" runat="server" Width="472px" RepeatDirection="Horizontal">
    <asp:ListItem Value="1" Selected="True">语文</asp:ListItem>
    <asp:ListItem Value="2">数学</asp:ListItem>
    <asp:ListItem Value="3">英语</asp:ListItem>
    <asp:ListItem Value="4">科学</asp:ListItem>
    </asp:radiobuttonlist></TD>
    </TR>
    <TR>
    <TD style="HEIGHT: 69px" align="center">
    <P><asp:textbox id="tbtext" runat="server" Height="160px" TextMode="MultiLine" Width="471px"></asp:textbox></P>
    </TD>
    </TR>
    <TR>
    <TD align="center"><asp:button id="Button1" runat="server" Width="54px" Text="发布"></asp:button><FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </FONT>
    <asp:button id="Button2" runat="server" Text="清空内容"></asp:button></TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </FONT>
    </P>
    <TABLE id="Table5" style="Z-INDEX: 105; LEFT: 40px; WIDTH: 184px; POSITION: absolute; TOP: 96px; HEIGHT: 262px"
    cellSpacing="1" cellPadding="1" width="184" border="0">
    <TR>
    <TD>
    <uc1:directe id="Directe1" runat="server"></uc1:directe></TD>
    </TR>
    </TABLE>
    <asp:label id="Label1" runat="server" Width="200px" style="Z-INDEX: 106; LEFT: 440px; POSITION: absolute; TOP: 72px"></asp:label>
    </body>
    </HTML>
      

  4.   

    你把</from>移动</body>前面