急!!!请大家快来帮帮忙拉,谢谢,散分(datagrid和calendar的问题)

maifans 2003-08-21 01:43:35
为什么我在datagrid里加了按钮列和在calendar里放了hyperlink,但是一按就出错:“类型“Button”的控件“Button1”必须放在具有 runat=server 的窗体标记内。”,以前是在html的body里加一句:"<form id="a" runat="server"></form>"
就好了,但现在还是出错是为什么啊?救命拉!!!
...全文
31 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
念.夕夏 2004-03-08
  • 打赏
  • 举报
回复
试试这样吧!
<asp:table id="table1" runat="server" Height="80px" align="center">
<asp:TableRow align="center">
<asp:TableCell bgcolor="d6f7ff">
<asp:calendar id="c1" runat="server" Width="840px" Height="234px" BackColor="White" ShowGridLines="True"
DayNameFormat="Full" BorderColor="Silver" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" BorderWidth="1px">
<TodayDayStyle ForeColor="White" BackColor="#FF8080"></TodayDayStyle>
SelectorStyle BackColor="#FFCC66"></SelectorStyle>
<NextPrevStyle Font-Size="9pt" ForeColor="DarkGoldenrod"></NextPrevStyle>
<DayHeaderStyle Height="1px" BorderWidth="1px" BackColor="#E9EDF1"></DayHeaderStyle>
<SelectedDayStyle Font-Bold="True" BackColor="#CCCCFF"></SelectedDayStyle>
<TitleStyle Font-Size="9pt" Font-Bold="True" ForeColor="#404040" BackColor="#E9EDF1"></TitleStyle>
<OtherMonthDayStyle ForeColor="#CC9966"></OtherMonthDayStyle>
</asp:calendar>
</asp:TableCell bgcolor="d6f7ff">
</asp:TableRow align="center">
</asp:table>
sunny6281 2004-03-08
  • 打赏
  • 举报
回复
up
maifans 2003-08-21
  • 打赏
  • 举报
回复
<HTML>
<HEAD>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</HEAD>
<body>
<form id="a" runat="server"><asp:datagrid id="DataGrid1" runat="server" CssClass="tablecontent" AutoGenerateColumns="False"
Width="496px" Height="32px">
<AlternatingItemStyle BackColor="#F3F3F3"></AlternatingItemStyle>
<ItemStyle Height="35px" BackColor="White"></ItemStyle>
<HeaderStyle Height="1px"></HeaderStyle>
<Columns>
<asp:BoundColumn Visible="False" HeaderImageUrl="file:///C:\Inetpub\wwwroot\efficiency\images\blank.gif"
DataField="noteID"></asp:BoundColumn>
<asp:ButtonColumn HeaderImageUrl="file:///C:\Inetpub\wwwroot\efficiency\images\blank.gif" DataTextField="title"
CommandName="show"></asp:ButtonColumn>
</Columns>
<PagerStyle NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Right"></PagerStyle>
</asp:datagrid><asp:calendar id="c1" runat="server" Width="840px" Height="234px" BackColor="White" ShowGridLines="True"
DayNameFormat="Full" BorderColor="Silver" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399"
BorderWidth="1px">
<TodayDayStyle ForeColor="White" BackColor="#FF8080"></TodayDayStyle>
<SelectorStyle BackColor="#FFCC66"></SelectorStyle>
<NextPrevStyle Font-Size="9pt" ForeColor="DarkGoldenrod"></NextPrevStyle>
<DayHeaderStyle Height="1px" BorderWidth="1px" BackColor="#E9EDF1"></DayHeaderStyle>
<SelectedDayStyle Font-Bold="True" BackColor="#CCCCFF"></SelectedDayStyle>
<TitleStyle Font-Size="9pt" Font-Bold="True" ForeColor="#404040" BackColor="#E9EDF1"></TitleStyle>
<OtherMonthDayStyle ForeColor="#CC9966"></OtherMonthDayStyle>
</asp:calendar> </form>
</body>
</HTML>
代码很长,有关datagrid和calendar的就是上面这些。
cm8983 2003-08-21
  • 打赏
  • 举报
回复
贴出你的代码
lwgj 2003-08-21
  • 打赏
  • 举报
回复
把aspx页面代码代码贴出来看看
maifans 2003-08-21
  • 打赏
  • 举报
回复
是啊,我把form放在<body></body>之间的啊
datagrid和calendar都在里面的啊
就是:<body><form><asp datagrid></asp></form></body>这样的啊
acewang 2003-08-21
  • 打赏
  • 举报
回复
你查看一下源代码,看看datagrid 是否真的在你的"<form id="a" runat="server"></form>"里面
kuanglonggjf 2003-08-21
  • 打赏
  • 举报
回复
把具体的代码贴出来

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧