datalist控件里 imagebutton控件的错误

owen899 2009-01-15 09:19:15
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" Debug="true"%>
<asp:DataList ID="DataList1" runat="server" OnItemCommand="DataList1_ItemCommand" >
<ItemTemplate>

<table>
<tr><td>
<asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"id") %>'></asp:Label>
</td></tr>
<tr><td>
<asp:Label ID="Label2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"name") %>'></asp:Label>
</td></tr>

</table>
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="redirct" CommandArgument="<%#Eval("id")%>" />
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>

</ItemTemplate>
</asp:DataList>
错误 2 “System.Web.UI.WebControls.ImageButton”内不允许包含文字内容(“" > LinkButton</asp:LinkButton> </ItemTemplate> </asp:DataList>”)。

这个错误怎么改?什么意思?

还有
错误 1 类型“System.Web.UI.WebControls.ImageButton”不具有名为“LinkButton”的公共属性。
这个错误是什么意思

哪位高手帮忙改一下 看一下 谢谢

...全文
110 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jiang_jiajia10 2009-01-15
  • 打赏
  • 举报
回复
CommandArgument='<%#Eval("id")%>'
hubblebubblepig 2009-01-15
  • 打赏
  • 举报
回复
ImageButton的CommandArgument外面那层的引号用单引号
Jinglecat 2009-01-15
  • 打赏
  • 举报
回复
try ->

<asp:ImageButton ID="ImageButton1" runat="server" CommandName="redirct" CommandArgument='<%# Eval("id")%>' />
zjybushiren88888 2009-01-15
  • 打赏
  • 举报
回复
顶个,看看
zetee 2009-01-15
  • 打赏
  • 举报
回复
意思你你字体添加标签的时候,自己写错了。

<asp:ImageButton ID="ImageButton1" runat="server" CommandName="redirct" CommandArgument=" <%#Eval("id")%>" />
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton </asp:LinkButton>
jiang_jiajia10 2009-01-15
  • 打赏
  • 举报
回复
你都放到Table里看看

62,269

社区成员

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

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

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

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