输入“System.Web.UI.WebControls.ImageButton”没有名为“TemplateField”的公共属性
<asp:GridView ID="grdCatgory" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Description" HeaderText="Description" />
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" CommandArgument="<%Eval("CategoryID")%>"
CommandName="Edit" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:ImageButton ID="imgDel" runat="server" CommandArgument="<%Eval("CategoryID")%>"
CommandName="Del" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
我在构建网站时遇到以下错误...
Type 'System.Web.UI.WebControls.ImageButton' does not have a public property named 'TemplateField'
<asp:GridView ID="grdCatgory" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Description" HeaderText="Description" />
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" CommandArgument="<%Eval("CategoryID")%>"
CommandName="Edit" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:ImageButton ID="imgDel" runat="server" CommandArgument="<%Eval("CategoryID")%>"
CommandName="Del" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
i am getting following error when build the website...
Type 'System.Web.UI.WebControls.ImageButton' does not have a public property named 'TemplateField'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为
CommandArgument="<%Eval("CategoryID")%>"
需要更改为
I think
CommandArgument="<%Eval("CategoryID")%>"
need change to