Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我给出错误的代码-
OnClientClick='javascript:DragRevId(<%# XPath("ReservationId") %>);return false;'
这可能与 XPath 使用 '\' 字符这一事实有关。如果您想将它与 javascript 一起使用,您需要转义该字符。
示例:Node\Child --> Node\\Child
因此,在 ASP 中,执行 String.Replace('\', "\\"); 或类似的东西。
如果这不起作用,您可能需要考虑发布引发的错误,并指定它是 ASP.Net 错误还是 Javascript 错误。