你查看一下源代码,看看datagrid 是否真的在你的"<form id="a" runat="server"></form>"里面

解决方案 »

  1.   

    是啊,我把form放在<body></body>之间的啊
    datagrid和calendar都在里面的啊
    就是:<body><form><asp datagrid></asp></form></body>这样的啊
      

  2.   

    把aspx页面代码代码贴出来看看
      

  3.   

    <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的就是上面这些。
      

  4.   

    试试这样吧!
    <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>