Server tag : The server tag is not well formed

不想你离开。 提交于 2019-12-13 08:56:23

问题


I got this error and I don't know what's wrong with my code...here it is:

<asp:LinkButton runat="server" ID="lnkbtnPDFPreview" Text="Preview" 
  CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>'                                
  CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>">
</asp:LinkButton>

回答1:


You are using " in the attribute value delimiter and inside the attribute:

CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>"

Change the outer delimiter to ' as already done for CommandArgument:

CommandName='<%# DataBinder.Eval(Container.DataItem,"documentID") %>'



回答2:


I suspect it's this line:

CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>"

You did the right thing here!

CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>'


来源:https://stackoverflow.com/questions/9570572/server-tag-the-server-tag-is-not-well-formed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!