日期:2014-05-17  浏览次数:20583 次

类型“LinkButton”的控件“ctl00_ContentPlaceHolder1_FirstPage”必须放在具有 runat=server 的窗体标记内
<div align="center">
  <asp:LinkButton ID="FirstPage" runat="server" OnClick="FirstPage_Click"><img alt="" src="images/frew.gif" /></asp:LinkButton>&nbsp;
  <asp:LinkButton ID="frontPage" runat="server" OnClick="frontPage_Click"><img alt="" src="images/rew.gif" /></asp:LinkButton>&nbsp;
  <asp:LinkButton ID="CurrentPage" runat="server" OnClick="CurrentPage_Click">[]</asp:LinkButton>&nbsp;
  <asp:LinkButton ID="CurrentPageAndOne" runat="server" OnClick="CurrentPageAndOne_Click">[]</asp:LinkButton>&nbsp;
  <asp:LinkButton ID="CurrentPageAndTwo" runat="server" OnClick="CurrentPageAndTwo_Click">[]</asp:LinkButton>&nbsp;
  <asp:LinkButton ID="CurrentPageAndThree" runat="server" OnClick="CurrentPageAndThree_Click">[]</asp:LinkButton>&nbsp;
  <asp:LinkButton ID="nextPage" runat="server" OnClick="nextPage_Click"><img alt="" src="images/fwd.gif" /></asp:LinkButton>&nbsp;
  <asp:LinkButton ID="lastPage" runat="server" onclick="lastPage_Click" ><img alt="" src="images/dfr.jpg" /></asp:LinkButton>&nbsp;
  页次:<asp:Label ID="CurrentPageIndex" runat="server"></asp:Label>/<asp:Label ID="PageMaxNum" runat="server"></asp:Label>页&nbsp;每页12/共<asp:Label ID="productCount" runat="server"></asp:Label>条记录
  </div>

这是我的HTML代码 运行出现下列错误,难道linkbutton的text不能写<img>吗 错误如下:
类型“LinkButton”的控件“ctl00_ContentPlaceHolder1_FirstPage”必须放在具有 runat=server 的窗体标记内。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Web.HttpException: 类型“LinkButton”的控件“ctl00_ContentPlaceHolder1_FirstPage”必须放在具有 runat=server 的窗体标记内。


------解决方案--------------------
看你母版页的代码,给母版中最的 form 加runat="server"