行 LinkButton 声明中的编译器错误消息
我有以下 ASP 代码:
<asp:LinkButton ID="LinkButton1" runat="server" Text="edit item" onclick='AddItem.aspx?catid=<%# Eval("CollectionID")%>' />
在这一行中,我收到错误编译:
编译器错误消息:CS1040:预处理器指令必须显示为行上的第一个非空白字符
为什么会收到此错误以及如何修复它? 先感谢您!
I have the following ASP code:
<asp:LinkButton ID="LinkButton1" runat="server" Text="edit item" onclick='AddItem.aspx?catid=<%# Eval("CollectionID")%>' />
In this row i get Error compilation:
Compiler Error Message: CS1040: Preprocessor directives must appear as the first non-whitespace character on a line
Why do I get this error and how can i fix it?
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以用这种方式来做。
You can do it in this way.
您确定这条是导致问题的线路吗?一般来说,当您看到此错误时,这是因为您的 <@ > 有问题。代码顶部的页面指令。确保您的<@Page>指令是文件中的第一件事,并且格式正确,并且除了页面指令之外,代码中没有任何其他 <@ 符号。
Are you certain that this is the line causing the problem? Generally when you see this error it is because there is a problem with your <@ > page directives at the top of the code. Make sure your <@Page> directive is the very first thing in the file and that it's formatted correctly and that you don't have any other <@ symbols in your code aside from your page directives.