【问题标题】:Error : The server tag is not well formed错误:服务器标签格式不正确
【发布时间】:2014-05-18 04:53:21
【问题描述】:
<asp:Image ID="imgteacher" runat="server" Height="150" Width="248" ImageUrl="ShowImage.ashx?id="+<%#Eval("CourseID") %>/>

请纠正我的写作错误。我认为我的问题是因为只有这一行,所以我只复制了这一行。

Parser Error Message: The server tag is not well formed.

【问题讨论】:

标签: c# asp.net eval


【解决方案1】:

错误消息的原因是ImageUrl 属性中的数据绑定。为了完成这项工作,您需要用单引号交换双引号并调整数据绑定代码:

<asp:Image ID="imgteacher" runat="server" Height="150" Width="248" 
    ImageUrl='<%# "ShowImage.ashx?id="+ DataBinder.Eval(Container.DataItem, "CourseID") %>'/>

【讨论】:

    【解决方案2】:

    试试这个

    ImageUrl 属性中的简单 wadata 绑定

    <asp:Image ID="imgteacher" runat="client" Height="150" Width="248" ImageUrl="ShowImage.ashx?id="+<%#Eval("CourseID") %>/>
    

    【讨论】:

      猜你喜欢
      • 2013-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-15
      • 2012-12-14
      相关资源
      最近更新 更多