【发布时间】:2014-04-30 20:39:06
【问题描述】:
我有以下代码 sn-p,但我正用头撞墙,试图从中找出错误。
我收到以下设计时编译错误:
; expected
The name button does not exist in the current context.
同样的两条消息也会在 DisplayReceipt 中重复。
这是我在 code behind 中为 html 分配的代码 sn-p。
有人可以帮帮我吗?
Image_ID = "<input id='" + fuelticket.Image_ID + "' type="button" onclick='" + DisplayReceipt(fuelticket.Image_ID)"'>";
【问题讨论】:
-
我认为您需要将“”周围的按钮更改为 '' 并在末尾添加一个 + .Image_ID)。
-
你不应该从你的代码中首先这样做。把它放在标记上,只修改后面代码中非静态的少数东西。
-
尽量避免在c#代码中混入html。
-
您的问题不完整,请提及 DisplayReceipt 应该作为 javascript 函数在客户端呈现。